mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 16:53:24 +00:00
[Fixed Position] Allow views to populate toolbar
Add a toolbar representer to share enough scope that views become capable of populating toolbars. Needed for toolbar of fixed position view, WTD-615.
This commit is contained in:
parent
61c3472266
commit
9d25359aa3
@ -2,13 +2,20 @@
|
|||||||
mct-object="domainObject"
|
mct-object="domainObject"
|
||||||
ng-model="representation">
|
ng-model="representation">
|
||||||
</mct-representation>
|
</mct-representation>
|
||||||
<div class="holder edit-area outline abs">
|
<div class="holder edit-area outline abs"
|
||||||
<!-- edit toolbar goes here -->
|
ng-init="toolbar = {}">
|
||||||
|
|
||||||
|
<mct-toolbar name="mctToolbar"
|
||||||
|
structure="toolbar.structure"
|
||||||
|
ng-model="toolbar.state">
|
||||||
|
</mct-toolbar>
|
||||||
|
|
||||||
<div class='split-layout vertical contents abs work-area'>
|
<div class='split-layout vertical contents abs work-area'>
|
||||||
<div class='abs pane left edit-main'>
|
<div class='abs pane left edit-main'>
|
||||||
<div class='holder abs object-holder'>
|
<div class='holder abs object-holder'>
|
||||||
<mct-representation key="representation.selected.key"
|
<mct-representation key="representation.selected.key"
|
||||||
mct-object="domainObject">
|
toolbar="toolbar"
|
||||||
|
mct-object="representation.selected.key && domainObject">
|
||||||
</mct-representation>
|
</mct-representation>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
37
platform/commonUI/edit/src/ToolbarRepresenter.js
Normal file
37
platform/commonUI/edit/src/ToolbarRepresenter.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/*global define*/
|
||||||
|
|
||||||
|
define(
|
||||||
|
[],
|
||||||
|
function () {
|
||||||
|
|
||||||
|
function ToolbarRepresenter(scope, element, attrs) {
|
||||||
|
var parent = scope.$parent;
|
||||||
|
|
||||||
|
function represent(domainObject, representation) {
|
||||||
|
// New domain object, clear out the tool bar
|
||||||
|
parent.toolbar = {};
|
||||||
|
scope.toolbar = parent.toolbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
/**
|
||||||
|
* Set the current representation in use, and the domain
|
||||||
|
* object being represented.
|
||||||
|
*
|
||||||
|
* @param {RepresentationDefinition} representation the
|
||||||
|
* definition of the representation in use
|
||||||
|
* @param {DomainObject} domainObject the domain object
|
||||||
|
* being represented
|
||||||
|
*/
|
||||||
|
represent: represent,
|
||||||
|
/**
|
||||||
|
* Release any resources associated with this representer.
|
||||||
|
*/
|
||||||
|
destroy: function () {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return ToolbarRepresenter;
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user