Improve more button implementation and fix lint.
This commit is contained in:
parent
8dff4a9478
commit
32776f0642
@ -109,13 +109,10 @@ export default {
|
||||
activeChannel: Object,
|
||||
networks: Array,
|
||||
},
|
||||
methods: {
|
||||
isPublic: () => document.body.classList.contains("public"),
|
||||
},
|
||||
mounted() {
|
||||
// Make a single throttled resize listener available to all components
|
||||
this.debouncedResize = throttle(() => {
|
||||
this.$root.$emit('resize');
|
||||
this.$root.$emit("resize");
|
||||
}, 100);
|
||||
|
||||
window.addEventListener("resize", this.debouncedResize, {passive: true});
|
||||
@ -123,5 +120,8 @@ export default {
|
||||
beforeDestroy() {
|
||||
window.removeEventListener("resize", this.debouncedResize);
|
||||
},
|
||||
methods: {
|
||||
isPublic: () => document.body.classList.contains("public"),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -147,16 +147,17 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
this.resizeListener = () => {this.handleResize()};
|
||||
this.$root.$on('resize', this.resizeListener);
|
||||
this.$root.$on("resize", this.handleResize);
|
||||
|
||||
this.onPreviewUpdate();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$root.$off("resize", this.handleResize);
|
||||
},
|
||||
destroyed() {
|
||||
// Let this preview go through load/canplay events again,
|
||||
// Otherwise the browser can cause a resize on video elements
|
||||
this.link.canDisplay = false;
|
||||
this.$root.$off('resize', this.resizeListener);
|
||||
},
|
||||
methods: {
|
||||
onPreviewUpdate() {
|
||||
|
@ -187,8 +187,7 @@ export default {
|
||||
|
||||
this.$refs.chat.addEventListener("scroll", this.debouncedScroll, {passive: true});
|
||||
|
||||
this.resizeListener = () => {this.handleResize()}
|
||||
this.$root.$on('resize', this.resizeListener);
|
||||
this.$root.$on("resize", this.handleResize);
|
||||
|
||||
this.$nextTick(() => {
|
||||
if (this.historyObserver) {
|
||||
@ -197,7 +196,7 @@ export default {
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$root.$off('resize', this.resizeListener);
|
||||
this.$root.$off("resize", this.handleResize);
|
||||
this.$refs.chat.removeEventListener("scroll", this.debouncedScroll);
|
||||
},
|
||||
destroyed() {
|
||||
|
Loading…
Reference in New Issue
Block a user