mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[Templates] Simplify MCTToolbar
Use mct-form as a basis; simply change the template.
This commit is contained in:
parent
2d03e3e6d4
commit
596735352a
@ -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;
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user