summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2015-07-04 15:47:36 (GMT)
committerxjm2015-07-04 15:47:36 (GMT)
commitb73d8872547a0899c9fad1080cb2b792e147b637 (patch)
tree72734f4a3e99b265f79b097e23cc715af5e7bf32
parent0e2ca036540cb18e72cf078e0bf518e82e693dbe (diff)
Issue #2505721 by eiriksm, nod_, jhodgdon: JSDoc color module
-rw-r--r--core/modules/color/color.js19
-rw-r--r--core/modules/color/preview.js10
2 files changed, 27 insertions, 2 deletions
diff --git a/core/modules/color/color.js b/core/modules/color/color.js
index 1a9d8a5..b41672e 100644
--- a/core/modules/color/color.js
+++ b/core/modules/color/color.js
@@ -8,7 +8,12 @@
"use strict";
/**
+ * Displays farbtastic color selector and initialize color administration UI.
+ *
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attach color selection behavior to relevant context.
*/
Drupal.behaviors.color = {
attach: function (context, settings) {
@@ -95,10 +100,14 @@
* @function Drupal.color~shift_color
*
* @param {string} given
- * @param {Array} ref1
- * @param {Array} ref2
+ * A hex color code to shift.
+ * @param {Array.<number>} ref1
+ * First HSL color reference.
+ * @param {Array.<number>} ref2
+ * Second HSL color reference.
*
* @return {string}
+ * A hex color, shifted.
*/
function shift_color(given, ref1, ref2) {
var d;
@@ -143,9 +152,14 @@
* Callback for Farbtastic when a new color is chosen.
*
* @param {HTMLElement} input
+ * The input element where the color is chosen.
* @param {string} color
+ * The color that was chosen through the input.
* @param {bool} propagate
+ * Whether or not to propagate the color to a locked pair value
* @param {bool} colorScheme
+ * Flag to indicate if the user is using a color scheme when changing
+ * the color.
*/
function callback(input, color, propagate, colorScheme) {
var matched;
@@ -201,6 +215,7 @@
* Focuses Farbtastic on a particular field.
*
* @param {jQuery.Event} e
+ * The focus event on the field.
*/
function focus(e) {
var input = e.target;
diff --git a/core/modules/color/preview.js b/core/modules/color/preview.js
index 956b53e..551cfd7 100644
--- a/core/modules/color/preview.js
+++ b/core/modules/color/preview.js
@@ -8,17 +8,27 @@
"use strict";
/**
+ * Namespace for color-related functionality for Drupal.
+ *
* @namespace
*/
Drupal.color = {
/**
+ * 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;