X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcolor%2Fpreview.js;fp=web%2Fcore%2Fmodules%2Fcolor%2Fpreview.js;h=b4bcbcc896486da1c664c3019964823e6c5d52c5;hp=38c62aef2679e43f42da14ef6e6ef144800d9aba;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/color/preview.js b/web/core/modules/color/preview.js index 38c62aef2..b4bcbcc89 100644 --- a/web/core/modules/color/preview.js +++ b/web/core/modules/color/preview.js @@ -1,42 +1,18 @@ /** - * @file - * Attaches preview-related behavior for the Color module. - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ (function ($, Drupal) { - - 'use strict'; - - /** - * Namespace for color-related functionality for Drupal. - * - * @namespace - */ Drupal.color = { + callback: function callback(context, settings, form, farb, height, width) { + var accum = void 0; + var delta = void 0; - /** - * The callback for when the color preview has been attached. - * - * @param {Element} context - * The context to initiate the color behaviour. - * @param {object} settings - * Settings for the color functionality. - * @param {HTMLFormElement} form - * The form to initiate the color behaviour on. - * @param {object} farb - * The farbtastic object. - * @param {number} height - * Height of gradient. - * @param {number} width - * Width of gradient. - */ - callback: function (context, settings, form, farb, height, width) { - var accum; - var delta; - // Solid background. form.find('.color-preview').css('backgroundColor', form.find('.color-palette input[name="palette[base]"]').val()); - // Text preview. form.find('#text').css('color', form.find('.color-palette input[name="palette[text]"]').val()); form.find('#text a, #text h2').css('color', form.find('.color-palette input[name="palette[link]"]').val()); @@ -49,9 +25,8 @@ element.style.backgroundColor = farb.pack(accum); } - // Set up gradients if there are some. - var color_start; - var color_end; + var color_start = void 0; + var color_end = void 0; for (var i in settings.gradients) { if (settings.gradients.hasOwnProperty(i)) { color_start = farb.unpack(form.find('.color-palette input[name="palette[' + settings.gradients[i].colors[0] + ']"]').val()); @@ -64,11 +39,11 @@ } } accum = color_start; - // Render gradient lines. + form.find('#gradient-' + i + ' > div').each(gradientLineColor); } } } } }; -})(jQuery, Drupal); +})(jQuery, Drupal); \ No newline at end of file