Skip to content

Commit

Permalink
compress property
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Mar 25, 2020
1 parent 2c5c89c commit 4e3d4ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dist/pseudo-window.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions src/pseudo-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {
},

computed: {
target() {
M_target() {
if (this.body) { return window.document.body; }
if (this.document) { return window.document; }
return window;
Expand All @@ -28,18 +28,22 @@ export default {
mounted() {
bindEventListners(
this.$listeners,
this.target,
this.M_target,
this.M_handlers,
);

this.$watch(() => this.target, (target) => {
this.M_handlers = unbindEventListeners(this.M_handlers, target);
bindEventListners(
this.$listeners,
target,
this.M_handlers,
);
});
this.$watch(
() => this.M_target,
(target) => {
this.M_handlers = unbindEventListeners(this.M_handlers, target);

bindEventListners(
this.$listeners,
target,
this.M_handlers,
);
},
);
},

destroyed() {
Expand Down

0 comments on commit 4e3d4ad

Please sign in to comment.