Compare commits
4 Commits
tree-rever
...
subobject1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afdf6e7067 | ||
|
|
f8be42f82d | ||
|
|
1ccc0780c8 | ||
|
|
830d042cea |
@@ -498,7 +498,7 @@ define([
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "object-inspector",
|
||||
"key": "legacy-object-inspector",
|
||||
"template": objectInspectorTemplate
|
||||
}
|
||||
],
|
||||
|
||||
@@ -23,19 +23,23 @@
|
||||
define([
|
||||
'legacyRegistry',
|
||||
'./actions/ActionDialogDecorator',
|
||||
'./controllers/InspectorAdapterController',
|
||||
'./directives/MCTView',
|
||||
'./services/Instantiate',
|
||||
'./capabilities/APICapabilityDecorator',
|
||||
'./policies/AdapterCompositionPolicy',
|
||||
'./runs/AlternateCompositionInitializer'
|
||||
'./runs/AlternateCompositionInitializer',
|
||||
'text!./templates/object-inspector-replacement.html'
|
||||
], function (
|
||||
legacyRegistry,
|
||||
ActionDialogDecorator,
|
||||
InspectorAdapterController,
|
||||
MCTView,
|
||||
Instantiate,
|
||||
APICapabilityDecorator,
|
||||
AdapterCompositionPolicy,
|
||||
AlternateCompositionInitializer
|
||||
AlternateCompositionInitializer,
|
||||
objectInspectorTemplate
|
||||
) {
|
||||
legacyRegistry.register('src/adapter', {
|
||||
"extensions": {
|
||||
@@ -77,6 +81,13 @@ define([
|
||||
depends: ["openmct"]
|
||||
}
|
||||
],
|
||||
controllers: [
|
||||
{
|
||||
"key": "InspectorAdapterController",
|
||||
implementation: InspectorAdapterController,
|
||||
depends: ["$scope", "openmct"]
|
||||
}
|
||||
],
|
||||
policies: [
|
||||
{
|
||||
category: "composition",
|
||||
@@ -90,6 +101,13 @@ define([
|
||||
depends: ["openmct"]
|
||||
}
|
||||
],
|
||||
representations: [
|
||||
{
|
||||
key: "object-inspector",
|
||||
priority: "mandatory",
|
||||
template: objectInspectorTemplate
|
||||
}
|
||||
],
|
||||
licenses: [
|
||||
{
|
||||
"name": "almond",
|
||||
|
||||
54
src/adapter/controllers/InspectorAdapterController.js
Normal file
54
src/adapter/controllers/InspectorAdapterController.js
Normal file
@@ -0,0 +1,54 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT, Copyright (c) 2014-2016, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
define([], function () {
|
||||
/**
|
||||
* Controller for the object-inspector used in the adapter
|
||||
* layer of the new API.
|
||||
* @constructor
|
||||
* @private
|
||||
*/
|
||||
function InspectorAdapterController($scope, openmct) {
|
||||
var changeCallback = this.selectionChanged.bind(this);
|
||||
|
||||
this.hasViewFlag = false;
|
||||
|
||||
openmct.selection.on('change', changeCallback);
|
||||
$scope.$on('$destroy', function () {
|
||||
openmct.selection.off('change', changeCallback);
|
||||
});
|
||||
}
|
||||
|
||||
InspectorAdapterController.prototype.selectionChanged = function () {
|
||||
|
||||
};
|
||||
|
||||
InspectorAdapterController.prototype.toggle = function () {
|
||||
this.hasViewFlag = !this.hasViewFlag;
|
||||
};
|
||||
|
||||
InspectorAdapterController.prototype.hasView = function () {
|
||||
return this.hasViewFlag;
|
||||
};
|
||||
|
||||
return InspectorAdapterController;
|
||||
});
|
||||
10
src/adapter/templates/object-inspector-replacement.html
Normal file
10
src/adapter/templates/object-inspector-replacement.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div ng-controller="InspectorAdapterController as adapter"
|
||||
ng-click="adapter.toggle()">
|
||||
<span ng-if="adapter.hasView()">Legacy inspector suppressed</span>
|
||||
<div ng-if="!adapter.hasView()">
|
||||
<mct-representation key="'legacy-object-inspector'"
|
||||
mct-object="domainObject"
|
||||
ng-model="ngModel">
|
||||
</mct-representation>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user