From 596735352ae8aa461cc3e52b734ee95ae9edcb44 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Fri, 26 Feb 2016 15:17:31 -0800 Subject: [PATCH] [Templates] Simplify MCTToolbar Use mct-form as a basis; simply change the template. --- platform/forms/src/MCTToolbar.js | 36 ++++++++------------------------ 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/platform/forms/src/MCTToolbar.js b/platform/forms/src/MCTToolbar.js index 15e3523d11..42c93c4842 100644 --- a/platform/forms/src/MCTToolbar.js +++ b/platform/forms/src/MCTToolbar.js @@ -25,8 +25,8 @@ * Module defining MCTForm. Created by vwoeltje on 11/10/14. */ define( - ["./controllers/FormController", "text!../res/templates/toolbar.html"], - function (FormController, toolbarTemplate) { + ["./MCTForm", "text!../res/templates/toolbar.html"], + function (MCTForm, toolbarTemplate) { "use strict"; /** @@ -49,32 +49,14 @@ define( * @memberof platform/forms * @constructor */ - function MCTForm() { - return { - // Only show at the element level - restrict: "E", - - // Load the forms template - template: toolbarTemplate, - - // Use FormController to populate/respond to changes in scope - controller: [ '$scope', FormController ], - - // Initial an isolate scope - scope: { - - // The model: Where form input will actually go - ngModel: "=", - - // Form structure; what sections/rows to show - structure: "=", - - // Name under which to publish the form - name: "@" - } - }; + function MCTToolbar() { + // Use Directive Definition Object from mct-form, + // but use the toolbar's template instead. + var ddo = new MCTForm(); + ddo.template = toolbarTemplate; + return ddo; } - return MCTForm; + return MCTToolbar; } );