Skip to content

Commit 47fe08f

Browse files
committed
Popover - default behavior is on Popover at a time.
1 parent a2aba67 commit 47fe08f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

js/trackViewport.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ class TrackViewport extends Viewport {
4949

5050
this.popoverList = undefined
5151

52+
this.browser.on('willpresentpopover', trackViewport => {
53+
54+
if (trackViewport !== this && this.popoverList) {
55+
56+
for (let i = 0; i < this.popoverList.length; i++ ) {
57+
this.popoverList[ i ].dispose()
58+
}
59+
60+
this.popoverList = undefined
61+
}
62+
63+
})
64+
65+
5266
}
5367

5468
setContentHeight(contentHeight) {
@@ -768,6 +782,8 @@ class TrackViewport extends Viewport {
768782
const content = this.getPopupContent(event)
769783
if (content) {
770784

785+
this.browser.fireEvent('willpresentpopover', [this])
786+
771787
if (undefined === this.popoverList) {
772788
this.popoverList = []
773789
}

0 commit comments

Comments
 (0)