mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 16:53:24 +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.
|
* Module defining MCTForm. Created by vwoeltje on 11/10/14.
|
||||||
*/
|
*/
|
||||||
define(
|
define(
|
||||||
["./controllers/FormController", "text!../res/templates/toolbar.html"],
|
["./MCTForm", "text!../res/templates/toolbar.html"],
|
||||||
function (FormController, toolbarTemplate) {
|
function (MCTForm, toolbarTemplate) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,32 +49,14 @@ define(
|
|||||||
* @memberof platform/forms
|
* @memberof platform/forms
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function MCTForm() {
|
function MCTToolbar() {
|
||||||
return {
|
// Use Directive Definition Object from mct-form,
|
||||||
// Only show at the element level
|
// but use the toolbar's template instead.
|
||||||
restrict: "E",
|
var ddo = new MCTForm();
|
||||||
|
ddo.template = toolbarTemplate;
|
||||||
// Load the forms template
|
return ddo;
|
||||||
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: "@"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return MCTForm;
|
return MCTToolbar;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user