openmct/src/plugins/imagery/ImageryViewProvider.js
Nikhil 3b195e9c7d Example imagery vue (#2525)
* WIP: imagery vue refactor

* cleaup

* show orange border when paused.

* resize image and thumbs wrappers.

* scrollToBottom fixed.

* fixed lint errors

* use multipane vue component for resize + cleanup + style adjustments.

* added min-height to image pane and thumbs-layout pane.

* remove old plugin and using es6 const.

* using ES6 imports.

* clean up + formatting changes.

* updated as per review comments.

* extracted styles from vue component.

* fixed lint errors.

* updated as per review comments + cleanup.
2019-12-13 15:36:01 -08:00

48 lines
1.4 KiB
JavaScript

import ImageryViewLayout from './components/ImageryViewLayout.vue';
import Vue from 'vue';
export default function ImageryViewProvider(openmct) {
const type = 'example.imagery';
const hasImageTelemetry = function (domainObject) {
const metadata = openmct.telemetry.getMetadata(domainObject);
if (!metadata) {
return false;
}
return metadata.valuesForHints(['image']).length > 0;
};
return {
key: type,
name: 'Imagery Layout',
cssClass: 'icon-image',
canView: function (domainObject) {
return hasImageTelemetry(domainObject);
},
view: function (domainObject) {
let component;
return {
show: function (element) {
component = new Vue({
components: {
ImageryViewLayout
},
provide: {
openmct,
domainObject
},
el: element,
template: '<imagery-view-layout ref="ImageryLayout"></imagery-view-layout>'
});
},
destroy: function () {
component.$destroy();
component = undefined;
}
};
}
}
}