[Code Style] Use prototypes in forms bundle

WTD-1482.
This commit is contained in:
Victor Woeltjen
2015-08-14 13:40:33 -07:00
parent 1c187c3914
commit 7fe866060b
4 changed files with 42 additions and 45 deletions

View File

@@ -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;
}
);