/**
- * @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());
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());
}
}
accum = color_start;
- // Render gradient lines.
+
form.find('#gradient-' + i + ' > div').each(gradientLineColor);
}
}
}
}
};
-})(jQuery, Drupal);
+})(jQuery, Drupal);
\ No newline at end of file