diff --git a/platform/features/scrolling/src/ScrollingListController.js b/platform/features/scrolling/src/ScrollingListController.js index c6a9f48fd9..7ca6312369 100644 --- a/platform/features/scrolling/src/ScrollingListController.js +++ b/platform/features/scrolling/src/ScrollingListController.js @@ -39,6 +39,7 @@ define( * @constructor */ function ScrollingListController($scope, formatter) { + var populator = new ScrollingListPopulator([]); // Get a set of populated, ready-to-display rows for the // latest data values. diff --git a/platform/forms/src/controllers/ColorController.js b/platform/forms/src/controllers/ColorController.js index e85fbe97d2..62640364df 100644 --- a/platform/forms/src/controllers/ColorController.js +++ b/platform/forms/src/controllers/ColorController.js @@ -89,6 +89,13 @@ define( } } + /** + * Get groups of colors to display in a color picker. These are + * given as #-prefixed color strings, in a two-dimensional array. + * Each element of the array is a group of related colors (e.g. + * grayscale colors, web colors, gradients...) + * @returns {string[][]} groups of colors + */ ColorController.prototype.groups = function () { return GROUPS; }; diff --git a/platform/forms/src/controllers/CompositeController.js b/platform/forms/src/controllers/CompositeController.js index e3a0559d09..506fbb6f4e 100644 --- a/platform/forms/src/controllers/CompositeController.js +++ b/platform/forms/src/controllers/CompositeController.js @@ -39,32 +39,25 @@ define( * @constructor */ function CompositeController() { - // Check if an element is defined; the map step of isNonEmpty - function isDefined(element) { - return typeof element !== 'undefined'; - } - - // Boolean or; the reduce step of isNonEmpty - function or(a, b) { - return a || b; - } - - return { - /** - * Check if an array contains anything other than - * undefined elements. - * @param {Array} value the array to check - * @returns {boolean} true if any non-undefined - * element is in the array - * @memberof platform/forms.CompositeController# - */ - isNonEmpty: function (value) { - return Array.isArray(value) && - value.map(isDefined).reduce(or, false); - } - }; } + // Check if an element is defined; the map step of isNonEmpty + function isDefined(element) { + return typeof element !== 'undefined'; + } + + /** + * Check if an array contains anything other than + * undefined elements. + * @param {Array} value the array to check + * @returns {boolean} true if any non-undefined + * element is in the array + * @memberof platform/forms.CompositeController# + */ + CompositeController.prototype.isNonEmpty = function (value) { + return Array.isArray(value) && value.some(isDefined); + }; + return CompositeController; } diff --git a/platform/forms/src/controllers/DialogButtonController.js b/platform/forms/src/controllers/DialogButtonController.js index afb0e54391..2c440dead1 100644 --- a/platform/forms/src/controllers/DialogButtonController.js +++ b/platform/forms/src/controllers/DialogButtonController.js @@ -36,9 +36,8 @@ define( * for user input */ function DialogButtonController($scope, dialogService) { - var buttonStructure, - buttonForm, - field; + var self = this, + buttonForm; // Store the result of user input to the model function storeResult(result) { @@ -65,11 +64,11 @@ define( row.key = $scope.field; // Prepare the structure for the button itself - buttonStructure = {}; - buttonStructure.glyph = structure.glyph; - buttonStructure.name = structure.name; - buttonStructure.description = structure.description; - buttonStructure.click = showDialog; + self.buttonStructure = {}; + self.buttonStructure.glyph = structure.glyph; + self.buttonStructure.name = structure.name; + self.buttonStructure.description = structure.description; + self.buttonStructure.click = showDialog; // Prepare the form; a single row buttonForm = { @@ -79,21 +78,18 @@ define( } $scope.$watch('structure', refreshStructure); - - return { - /** - * Get the structure for an `mct-control` of type - * `button`; a dialog will be launched when this button - * is clicked. - * @returns dialog structure - * @memberof platform/forms.DialogButtonController# - */ - getButtonStructure: function () { - return buttonStructure; - } - }; } + /** + * Get the structure for an `mct-control` of type + * `button`; a dialog will be launched when this button + * is clicked. + * @returns dialog structure + */ + DialogButtonController.prototype.getButtonStructure = function () { + return this.buttonStructure; + }; + return DialogButtonController; } );