Skip to content

Commit 7b7c83d

Browse files
author
minjk-bl
committed
Frame, Subset Codeview, Dataview toggling
1 parent 8113008 commit 7b7c83d

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

src/common/vpFrameEditor.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ define([
770770

771771
/** open preview box */
772772
FrameEditor.prototype.openPreview = function() {
773+
this.closeDataview();
773774
$(this.wrapSelector('.' + VP_FE_PREVIEW_BOX)).show();
774775

775776
if (!this.cmpreviewall) {
@@ -823,6 +824,7 @@ define([
823824
}
824825

825826
FrameEditor.prototype.openDataview = function() {
827+
this.closePreview();
826828
this.dataviewOpened = true;
827829
$(this.wrapSelector('.' + VP_FE_INFO)).show();
828830
}
@@ -1343,8 +1345,13 @@ define([
13431345
// close menu
13441346
that.hideMenu();
13451347
}
1346-
if (!$(evt.target).hasClass('.' + VP_FE_BUTTON_DATAVIEW)) {
1347-
// close info
1348+
if (!$(evt.target).hasClass(VP_FE_BUTTON_PREVIEW)
1349+
&& !$(evt.target).hasClass(VP_FE_PREVIEW_BOX)
1350+
&& $(that.wrapSelector('.' + VP_FE_PREVIEW_BOX)).has(evt.target).length === 0) {
1351+
that.closePreview();
1352+
}
1353+
if (!$(evt.target).hasClass(VP_FE_BUTTON_DATAVIEW)
1354+
&& $(that.wrapSelector('.' + VP_FE_INFO)).has(evt.target).length === 0) {
13481355
that.closeDataview();
13491356
}
13501357
});
@@ -1638,14 +1645,14 @@ define([
16381645

16391646
// click others
16401647
$(document).on('click.' + this.uuid, function(evt) {
1641-
if (!$(evt.target).hasClass('.' + VP_FE_BUTTON_DETAIL)) {
1648+
if (!$(evt.target).hasClass(VP_FE_BUTTON_DETAIL)) {
16421649
$(that.wrapSelector('.' + VP_FE_DETAIL_BOX)).hide();
16431650
}
1644-
if (!$(evt.target).hasClass('.' + VP_FE_BUTTON_PREVIEW)
1651+
if (!$(evt.target).hasClass(VP_FE_BUTTON_PREVIEW)
16451652
&& $(that.wrapSelector('.' + VP_FE_PREVIEW_BOX)).has(evt.target).length === 0) {
16461653
that.closePreview();
16471654
}
1648-
if (!$(evt.target).hasClass('.' + VP_FE_BUTTON_DATAVIEW)
1655+
if (!$(evt.target).hasClass(VP_FE_BUTTON_DATAVIEW)
16491656
&& $(that.wrapSelector('.' + VP_FE_INFO)).has(evt.target).length === 0) {
16501657
that.closeDataview();
16511658
}

src/common/vpSubsetEditor.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,14 +1848,15 @@ define([
18481848

18491849
// click others
18501850
$(document).on('click.' + this.uuid, function(evt) {
1851-
if (!$(evt.target).hasClass('.' + VP_DS_BUTTON_DETAIL)) {
1851+
if (!$(evt.target).hasClass(VP_DS_BUTTON_DETAIL)) {
18521852
$(that.wrapSelector('.' + VP_DS_DETAIL_BOX)).hide();
18531853
}
1854-
if (!$(evt.target).hasClass('.' + VP_DS_BUTTON_PREVIEW)
1854+
if (!$(evt.target).hasClass(VP_DS_BUTTON_PREVIEW)
1855+
&& !$(evt.target).hasClass(VP_DS_PREVIEW_BOX)
18551856
&& $(that.wrapSelector('.' + VP_DS_PREVIEW_BOX)).has(evt.target).length === 0) {
18561857
that.closePreview();
18571858
}
1858-
if (!$(evt.target).hasClass('.' + VP_DS_BUTTON_DATAVIEW)
1859+
if (!$(evt.target).hasClass(VP_DS_BUTTON_DATAVIEW)
18591860
&& $(that.wrapSelector('.' + VP_DS_DATA)).has(evt.target).length === 0) {
18601861
that.closeDataview();
18611862
}
@@ -1967,6 +1968,7 @@ define([
19671968
}
19681969

19691970
SubsetEditor.prototype.openDataview = function() {
1971+
this.closePreview();
19701972
this.dataviewOpened = true;
19711973
$(this.wrapSelector('.' + VP_DS_DATA)).show();
19721974
}
@@ -1978,6 +1980,7 @@ define([
19781980

19791981
/** open preview box */
19801982
SubsetEditor.prototype.openPreview = function() {
1983+
this.closeDataview();
19811984
$(this.wrapSelector('.' + VP_DS_PREVIEW_BOX)).show();
19821985

19831986
if (!this.cmpreviewall) {

0 commit comments

Comments
 (0)