diff --git a/src/mixins/close-on-popstate.js b/src/mixins/close-on-popstate.js index ed98c5c18..21822a3d9 100644 --- a/src/mixins/close-on-popstate.js +++ b/src/mixins/close-on-popstate.js @@ -25,6 +25,11 @@ export const CloseOnPopstateMixin = { }, methods: { + onPopstate() { + this.close(); + this.shouldReopen = false; + }, + handlePopstate(bind) { /* istanbul ignore if */ if (this.$isServer) { @@ -34,10 +39,7 @@ export const CloseOnPopstateMixin = { if (this.bindStatus !== bind) { this.bindStatus = bind; const action = bind ? on : off; - action(window, 'popstate', () => { - this.close(); - this.shouldReopen = false; - }); + action(window, 'popstate', this.onPopstate); } }, },