diff options
Diffstat (limited to 'color/preview.js')
-rwxr-xr-x | color/preview.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/color/preview.js b/color/preview.js new file mode 100755 index 0000000..c5b2aa9 --- /dev/null +++ b/color/preview.js @@ -0,0 +1,31 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.color = { + logoChanged: false, + bgChanged: false, + callback: function callback(context, settings, $form) { + + var $colorPreview = $form.find('.color-preview'); + var $colorPalette = $form.find('.js-color-palette'); + + + $colorPreview.find('.color-preview-top-head *, .color-preview-footer-wrapper *').css('color', $colorPalette.find('input[name="palette[topnav]"]').val()); + $colorPreview.find('.color-preview-footer-wrapper, .color-preview-top-head').css('background-color', $colorPalette.find('input[name="palette[footer]"]').val()); + $colorPreview.find('.color-preview-main h2, .color-preview .preview-content, .color-preview-content h1, .preview-content ').css('color', $colorPalette.find('input[name="palette[text]"]').val()); + $colorPreview.find('.color-preview-content a, .color-preview-main-menu-links a, .color-preview-main-menu-links a:hover').css('color', $colorPalette.find('input[name="palette[link]"]').val()); + $colorPreview.find('.color-preview-site-name').css('color', $colorPalette.find('input[name="palette[footer]"]').val()); + $colorPreview.find('.color-preview-main-menu').css('background-color', $colorPalette.find('input[name="palette[top]"]').val()); + $colorPreview.find('.color-preview-main-menu-links li a').css('color', $colorPalette.find('input[name="palette[nav-text]"]').val()); + $colorPreview.find('.color-preview-block ').css('background-color', $colorPalette.find('input[name="palette[sidebar]"]').val()); + $colorPreview.find('.color-preview-main').css('background-color', $colorPalette.find('input[name="palette[bg]"]').val()); + $colorPreview.find('.color-preview-main-menu-links li a:hover,.color-preview-main-menu-links li a:focus').css('background-color', $colorPalette.find('input[name="palette[nav-hover]"]').val()); + + } + }; +})(jQuery, Drupal, drupalSettings);
\ No newline at end of file |