From ef6b243163eef31bbf96432ce2442be468ca96c6 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Wed, 23 Mar 2022 19:19:25 +1100 Subject: Place window-resize handling back in TileTree Reversion done to prevent flashes on window resize. --- src/App.vue | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'src/App.vue') diff --git a/src/App.vue b/src/App.vue index 7d1c7fa..b4254e7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,44 +3,6 @@ import {defineComponent} from 'vue'; import TileTree from './components/TileTree.vue'; export default defineComponent({ - data(){ - return { - width: document.documentElement.clientWidth, - height: document.documentElement.clientHeight, - // For window-resize-handler throttling - resizeThrottled: false, - resizeDelay: 50, //ms - } - }, - computed: { - styles(): Record { - return { - position: 'absolute', - left: '0', - top: '0', - width: this.width + 'px', - height: this.height + 'px', - backgroundColor: 'black', - }; - } - }, - methods: { - onResize(){ - if (!this.resizeThrottled){ - this.width = document.documentElement.clientWidth; - this.height = document.documentElement.clientHeight; - // Prevent re-triggering until after a delay - this.resizeThrottled = true; - setTimeout(() => {this.resizeThrottled = false;}, this.resizeDelay); - } - }, - }, - created(){ - window.addEventListener('resize', this.onResize); - }, - unmounted(){ - window.removeEventListener('resize', this.onResize); - }, components: { TileTree }, @@ -48,8 +10,6 @@ export default defineComponent({ -- cgit v1.2.3