diff options
author | David Tsay <3614296+davetsay@users.noreply.github.com> | 2019-12-20 03:20:58 +0300 |
---|---|---|
committer | Pegah Sarram <pegah.sarram@nasa.gov> | 2019-12-20 03:20:58 +0300 |
commit | 92c628e3899b28ee2b9893b10957797e56f541a5 (patch) | |
tree | b145881e2f83a9c5317c9c25d0c787f0d3a43fec | |
parent | 1205e6977c0e57ee111472a20efb62630d26ae1f (diff) |
by default add new frame to end of container (#2601)vista-4.3.0-rc7
-rw-r--r-- | src/plugins/flexibleLayout/components/flexibleLayout.vue | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/flexibleLayout/components/flexibleLayout.vue b/src/plugins/flexibleLayout/components/flexibleLayout.vue index 7e2c35169..bf2b0c0a0 100644 --- a/src/plugins/flexibleLayout/components/flexibleLayout.vue +++ b/src/plugins/flexibleLayout/components/flexibleLayout.vue @@ -540,18 +540,16 @@ export default { this.newFrameLocation = [containerIndex, insertFrameIndex]; }, addFrame(domainObject) { - if (this.newFrameLocation.length) { - let containerIndex = this.newFrameLocation[0], - frameIndex = this.newFrameLocation[1], - frame = new Frame(domainObject.identifier), - container = this.containers[containerIndex]; + let containerIndex = this.newFrameLocation.length ? this.newFrameLocation[0] : 0; + let container = this.containers[containerIndex]; + let frameIndex = this.newFrameLocation.length ? this.newFrameLocation[1] : container.frames.length; + let frame = new Frame(domainObject.identifier); - container.frames.splice(frameIndex + 1, 0, frame); - sizeItems(container.frames, frame); + container.frames.splice(frameIndex + 1, 0, frame); + sizeItems(container.frames, frame); - this.newFrameLocation = []; - this.persist(containerIndex); - } + this.newFrameLocation = []; + this.persist(containerIndex); }, deleteFrame(frameId) { let container = this.containers |