mirror of
https://github.com/nasa/openmct.git
synced 2025-05-15 23:12:54 +00:00
by default add new frame to end of container (#2603)
This commit is contained in:
parent
3b195e9c7d
commit
384f0efcb3
@ -232,18 +232,16 @@ export default {
|
|||||||
this.newFrameLocation = [containerIndex, insertFrameIndex];
|
this.newFrameLocation = [containerIndex, insertFrameIndex];
|
||||||
},
|
},
|
||||||
addFrame(domainObject) {
|
addFrame(domainObject) {
|
||||||
if (this.newFrameLocation.length) {
|
let containerIndex = this.newFrameLocation.length ? this.newFrameLocation[0] : 0;
|
||||||
let containerIndex = this.newFrameLocation[0],
|
let container = this.containers[containerIndex];
|
||||||
frameIndex = this.newFrameLocation[1],
|
let frameIndex = this.newFrameLocation.length ? this.newFrameLocation[1] : container.frames.length;
|
||||||
frame = new Frame(domainObject.identifier),
|
let frame = new Frame(domainObject.identifier);
|
||||||
container = this.containers[containerIndex];
|
|
||||||
|
|
||||||
container.frames.splice(frameIndex + 1, 0, frame);
|
container.frames.splice(frameIndex + 1, 0, frame);
|
||||||
sizeItems(container.frames, frame);
|
sizeItems(container.frames, frame);
|
||||||
|
|
||||||
this.newFrameLocation = [];
|
this.newFrameLocation = [];
|
||||||
this.persist(containerIndex);
|
this.persist(containerIndex);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
deleteFrame(frameId) {
|
deleteFrame(frameId) {
|
||||||
let container = this.containers
|
let container = this.containers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user