diff --git a/platform/commonUI/edit/res/templates/edit-object.html b/platform/commonUI/edit/res/templates/edit-object.html index a27016a3a4..c7339d0c4e 100644 --- a/platform/commonUI/edit/res/templates/edit-object.html +++ b/platform/commonUI/edit/res/templates/edit-object.html @@ -2,13 +2,20 @@ mct-object="domainObject" ng-model="representation"> -
- +
+ + + +
+ toolbar="toolbar" + mct-object="representation.selected.key && domainObject">
diff --git a/platform/commonUI/edit/src/ToolbarRepresenter.js b/platform/commonUI/edit/src/ToolbarRepresenter.js new file mode 100644 index 0000000000..97a424fc83 --- /dev/null +++ b/platform/commonUI/edit/src/ToolbarRepresenter.js @@ -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; + + } +); \ No newline at end of file