Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. private setColors(form: CustomForm) {
  2. if (!this.el) return;
  3.  
  4. this.el.nativeElement.style.setProperty(`--danger-color`, form.error_color);
  5. if (this.data.contact_form_font_color) {
  6. this.render.setStyle(this.el.nativeElement, 'color', this.data.contact_form_font_color);
  7. return;
  8. }
  9.  
  10. if (this.data.dynamic_form_font_color || this.data.dynamic_form_error_color || this.data.dynamic_form_button_color) {
  11. if (this.data.dynamic_form_font_color) {
  12. this.render.setStyle(this.el.nativeElement, 'color', this.data.dynamic_form_font_color);
  13. }
  14.  
  15. if (this.data.dynamic_form_error_color) {
  16. this.el.nativeElement.style.setProperty(`--danger-color`, this.data.dynamic_form_error_color);
  17. }
  18.  
  19. if (this.data.dynamic_form_button_color) {
  20. this.render.setStyle(this.btnSubmit.nativeElement, 'color', this.data.dynamic_form_button_color);
  21. }
  22. return;
  23. }
  24.  
  25. this.render.setStyle(this.el.nativeElement, 'color', form.font_color);
  26. this.render.setStyle(this.btnSubmit.nativeElement, 'color', form.button_font_color);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement