mirror of
https://github.com/nasa/openmct.git
synced 2025-03-12 23:44:08 +00:00
persist swimlane label width
This commit is contained in:
parent
6e209b2ac3
commit
c28f7b61d1
@ -129,11 +129,22 @@ export default {
|
||||
);
|
||||
|
||||
// Drag resizer - Swimlane column width
|
||||
const { x: swimLaneLabelWidth, mousedown } = useDragResizer({ initialX: 200 });
|
||||
const { x: swimLaneLabelWidth, mousedown } = useDragResizer({
|
||||
initialX: domainObject.configuration.swimLaneLabelWidth,
|
||||
callback: mutateSwimLaneLabelWidth
|
||||
});
|
||||
|
||||
provide('swimLaneLabelWidth', swimLaneLabelWidth);
|
||||
provide('mousedown', mousedown);
|
||||
|
||||
function mutateSwimLaneLabelWidth() {
|
||||
openmct.objects.mutate(
|
||||
domainObject,
|
||||
'configuration.swimLaneLabelWidth',
|
||||
swimLaneLabelWidth.value
|
||||
);
|
||||
}
|
||||
|
||||
// Flex containers - Swimlane height
|
||||
const timelineHolder = ref(null);
|
||||
|
||||
|
5
src/plugins/timeline/configuration.js
Normal file
5
src/plugins/timeline/configuration.js
Normal file
@ -0,0 +1,5 @@
|
||||
export const configuration = {
|
||||
useIndependentTime: false,
|
||||
containers: [],
|
||||
swimLaneLabelWidth: 200
|
||||
};
|
@ -20,6 +20,7 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
import { configuration } from './configuration.js';
|
||||
import ExtendedLinesBus from './ExtendedLinesBus.js';
|
||||
import TimelineCompositionPolicy from './TimelineCompositionPolicy.js';
|
||||
import timelineInterceptor from './timelineInterceptor.js';
|
||||
@ -40,10 +41,7 @@ export default function () {
|
||||
cssClass: 'icon-timeline',
|
||||
initialize: function (domainObject) {
|
||||
domainObject.composition = [];
|
||||
domainObject.configuration = {
|
||||
useIndependentTime: false,
|
||||
containers: []
|
||||
};
|
||||
domainObject.configuration = configuration;
|
||||
}
|
||||
});
|
||||
timelineInterceptor(openmct);
|
||||
|
@ -20,6 +20,8 @@
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
import { configuration } from './configuration.js';
|
||||
|
||||
export default function timelineInterceptor(openmct) {
|
||||
openmct.objects.addGetInterceptor({
|
||||
appliesTo: (identifier, domainObject) => {
|
||||
@ -27,11 +29,15 @@ export default function timelineInterceptor(openmct) {
|
||||
},
|
||||
invoke: (identifier, object) => {
|
||||
if (object && object.configuration === undefined) {
|
||||
object.configuration = {
|
||||
useIndependentTime: true
|
||||
};
|
||||
object.configuration = configuration;
|
||||
}
|
||||
|
||||
Object.keys(configuration).forEach((key) => {
|
||||
if (object.configuration[key] === undefined) {
|
||||
object.configuration[key] = configuration[key];
|
||||
}
|
||||
});
|
||||
|
||||
return object;
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user