mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +00:00
[API] Begin adding toolbar
This commit is contained in:
parent
96316de6e4
commit
c289a27305
1
tutorials/todo/todo-toolbar.html
Normal file
1
tutorials/todo/todo-toolbar.html
Normal file
@ -0,0 +1 @@
|
||||
This is a toolbar.
|
@ -1,8 +1,9 @@
|
||||
define([
|
||||
"text!./todo.html",
|
||||
"text!./todo-task.html",
|
||||
"text!./todo-toolbar.html",
|
||||
"zepto"
|
||||
], function (todoTemplate, taskTemplate, $) {
|
||||
], function (todoTemplate, taskTemplate, toolbarTemplate, $) {
|
||||
/**
|
||||
* @param {mct.MCT} mct
|
||||
*/
|
||||
@ -100,10 +101,27 @@ define([
|
||||
$message.toggle(tasks.length < 1);
|
||||
};
|
||||
|
||||
|
||||
|
||||
function TodoToolbarView(domainObject) {
|
||||
this.domainObject = domainObject;
|
||||
}
|
||||
|
||||
TodoToolbarView.prototype.show = function (container) {
|
||||
$(container).append($(toolbarTemplate));
|
||||
};
|
||||
|
||||
TodoToolbarView.prototype.destroy = function () {
|
||||
|
||||
};
|
||||
|
||||
mct.type('example.todo', todoType);
|
||||
mct.view(mct.regions.main, function (domainObject) {
|
||||
return todoType.check(domainObject) && new TodoView(domainObject);
|
||||
});
|
||||
mct.view(mct.regions.toolbar, function (domainObject) {
|
||||
return todoType.check(domainObject) && new TodoToolbarView(domainObject);
|
||||
});
|
||||
|
||||
return mct;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user