by default add new frame to end of container (#2603)

This commit is contained in:
David Tsay 2019-12-19 16:59:41 -08:00 committed by Pegah Sarram
parent 3b195e9c7d
commit 384f0efcb3

View File

@ -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