Closed ghost closed 7 years ago
In vex.combined.js, vex.closeAll is added as listener to the popstate event:
vex.combined.js
vex.closeAll
popstate
// Close all vexes on history pop state (useful in single page apps) window.addEventListener('popstate', vex.closeAll)
Thus, e.g. going back in history, thus activating the popstate event, runs vex.closeAll which is defined as follows:
// Close every vex! closeAll: function closeAll () { for (var id in vexes) { this.close(id) } return true },
In this particular call of close, this is window. Thus, going back in history, may close the window.
close
this
window
I created a merge request: #213. Please merge. Should I bump the version number?
Nevermind, is still an issue in the lastest release (3.0.0) but it's fixed in master branch.
In
vex.combined.js
,vex.closeAll
is added as listener to thepopstate
event:Thus, e.g. going back in history, thus activating the
popstate
event, runsvex.closeAll
which is defined as follows:In this particular call of
close
,this
iswindow
. Thus, going back in history, may close the window.