From 85a9d81638d240f3fa9ed01cb139ef33243b379b Mon Sep 17 00:00:00 2001 From: sanjeevi01 Date: Fri, 5 Jul 2019 15:30:52 +0530 Subject: Initial commit --- color/preview.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 color/preview.js (limited to 'color/preview.js') 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 -- cgit