camaleon-8.x-1.x-dev/color/preview.js
color/preview.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | /** * DO NOT EDIT THIS FILE. * See the following change record for more information, * @preserve **/ ( function ($, Drupal, drupalSettings) { Drupal.color = { logoChanged: false , callback: function callback(context, settings, $form) { if (! this .logoChanged) { $( '.color-preview .color-preview-logo img' ).attr( 'src' , drupalSettings.color.logo); this .logoChanged = true ; } if (drupalSettings.color.logo === null ) { $( 'div' ).remove( '.color-preview-logo' ); } var $colorPreview = $form.find( '.color-preview' ); var $colorPalette = $form.find( '.js-color-palette' ); $colorPreview.css( 'backgroundColor' , $colorPalette.find( 'input[name="palette[bg]"]' ).val()); $colorPreview.find( '.color-preview-main h2, .color-preview .preview-content' ).css( 'color' , $colorPalette.find( 'input[name="palette[text]"]' ).val()); $colorPreview.find( '.color-preview-content a' ).css( 'color' , $colorPalette.find( 'input[name="palette[link]"]' ).val()); var $colorPreviewBlock = $colorPreview.find( '.color-preview-sidebar .color-preview-block' ); $colorPreviewBlock.css( 'background-color' , $colorPalette.find( 'input[name="palette[sidebar]"]' ).val()); $colorPreviewBlock.css( 'border-color' , $colorPalette.find( 'input[name="palette[sidebarborders]"]' ).val()); $colorPreview.find( '.color-preview-footer-wrapper' ).css( 'background-color' , $colorPalette.find( 'input[name="palette[footer]"]' ).val()); var gradientStart = $colorPalette.find( 'input[name="palette[top]"]' ).val(); var gradientEnd = $colorPalette.find( 'input[name="palette[bottom]"]' ).val(); $colorPreview.find( '.color-preview-header' ).attr( 'style' , 'background-color: ' + gradientStart + '; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(' + gradientStart + '), to(' + gradientEnd + ')); background-image: -moz-linear-gradient(-90deg, ' + gradientStart + ', ' + gradientEnd + ');' ); $colorPreview.find( '.color-preview-site-name' ).css( 'color' , $colorPalette.find( 'input[name="palette[titleslogan]"]' ).val()); } }; })(jQuery, Drupal, drupalSettings); |