mirror of
https://github.com/nasa/openmct.git
synced 2025-03-13 07:54:13 +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
|
// 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('swimLaneLabelWidth', swimLaneLabelWidth);
|
||||||
provide('mousedown', mousedown);
|
provide('mousedown', mousedown);
|
||||||
|
|
||||||
|
function mutateSwimLaneLabelWidth() {
|
||||||
|
openmct.objects.mutate(
|
||||||
|
domainObject,
|
||||||
|
'configuration.swimLaneLabelWidth',
|
||||||
|
swimLaneLabelWidth.value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Flex containers - Swimlane height
|
// Flex containers - Swimlane height
|
||||||
const timelineHolder = ref(null);
|
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.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
import { configuration } from './configuration.js';
|
||||||
import ExtendedLinesBus from './ExtendedLinesBus.js';
|
import ExtendedLinesBus from './ExtendedLinesBus.js';
|
||||||
import TimelineCompositionPolicy from './TimelineCompositionPolicy.js';
|
import TimelineCompositionPolicy from './TimelineCompositionPolicy.js';
|
||||||
import timelineInterceptor from './timelineInterceptor.js';
|
import timelineInterceptor from './timelineInterceptor.js';
|
||||||
@ -40,10 +41,7 @@ export default function () {
|
|||||||
cssClass: 'icon-timeline',
|
cssClass: 'icon-timeline',
|
||||||
initialize: function (domainObject) {
|
initialize: function (domainObject) {
|
||||||
domainObject.composition = [];
|
domainObject.composition = [];
|
||||||
domainObject.configuration = {
|
domainObject.configuration = configuration;
|
||||||
useIndependentTime: false,
|
|
||||||
containers: []
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
timelineInterceptor(openmct);
|
timelineInterceptor(openmct);
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
* at runtime from the About dialog for additional information.
|
* at runtime from the About dialog for additional information.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
import { configuration } from './configuration.js';
|
||||||
|
|
||||||
export default function timelineInterceptor(openmct) {
|
export default function timelineInterceptor(openmct) {
|
||||||
openmct.objects.addGetInterceptor({
|
openmct.objects.addGetInterceptor({
|
||||||
appliesTo: (identifier, domainObject) => {
|
appliesTo: (identifier, domainObject) => {
|
||||||
@ -27,11 +29,15 @@ export default function timelineInterceptor(openmct) {
|
|||||||
},
|
},
|
||||||
invoke: (identifier, object) => {
|
invoke: (identifier, object) => {
|
||||||
if (object && object.configuration === undefined) {
|
if (object && object.configuration === undefined) {
|
||||||
object.configuration = {
|
object.configuration = configuration;
|
||||||
useIndependentTime: true
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object.keys(configuration).forEach((key) => {
|
||||||
|
if (object.configuration[key] === undefined) {
|
||||||
|
object.configuration[key] = configuration[key];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user