From 33e997c6b47af294607efe9b0d61cd1471151813 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Thu, 6 Aug 2020 15:19:57 +0200 Subject: [PATCH] chore: remove Chrome 77 hack --- studio/src/global/app-dev.ts | 51 -------------------------------- studio/src/global/app-staging.ts | 51 -------------------------------- studio/src/global/app.ts | 51 -------------------------------- 3 files changed, 153 deletions(-) diff --git a/studio/src/global/app-dev.ts b/studio/src/global/app-dev.ts index 6dd05b2ac..6d9f3b5e7 100644 --- a/studio/src/global/app-dev.ts +++ b/studio/src/global/app-dev.ts @@ -65,54 +65,3 @@ setupDeckGoConfig({ fontsUrl: 'https://fonts.googleapis.com/css?display=swap&family=', }, }); - -// https://github.com/deckgo/deckdeckgo/issues/327 -// https://github.com/ionic-team/ionic/issues/19065 - -const hack = () => { - const ionApp = document.querySelector('ion-app'); - - if (ionApp) { - window.requestAnimationFrame(() => { - ionApp.style.height = '100%'; - window.requestAnimationFrame(() => { - ionApp.style.height = ''; - }); - }); - } -}; - -let resizerObserver; - -document.addEventListener('DOMContentLoaded', () => { - if (!window) { - return; - } - - if ('ResizeObserver' in window) { - const ResizeObserver = (window as any).ResizeObserver; - resizerObserver = new ResizeObserver(hack); - resizerObserver.observe(document.documentElement); - } else { - window.addEventListener('keyboardWillShow', hack); - window.addEventListener('keyboardWillHide', hack); - window.addEventListener('resize', hack); - } -}); - -window.addEventListener('unload', () => { - if (!window) { - return; - } - - if ('ResizeObserver' in window) { - if (resizerObserver) { - resizerObserver.unobserve(document.documentElement); - resizerObserver.disconnect(); - } - } else { - window.removeEventListener('keyboardWillShow', hack); - window.removeEventListener('keyboardWillHide', hack); - window.removeEventListener('resize', hack); - } -}); diff --git a/studio/src/global/app-staging.ts b/studio/src/global/app-staging.ts index 3512cdcf3..a226e079f 100644 --- a/studio/src/global/app-staging.ts +++ b/studio/src/global/app-staging.ts @@ -63,54 +63,3 @@ setupDeckGoConfig({ fontsUrl: 'https://fonts.googleapis.com/css?display=swap&family=', }, }); - -// https://github.com/deckgo/deckdeckgo/issues/327 -// https://github.com/ionic-team/ionic/issues/19065 - -const hack = () => { - const ionApp = document.querySelector('ion-app'); - - if (ionApp) { - window.requestAnimationFrame(() => { - ionApp.style.height = '100%'; - window.requestAnimationFrame(() => { - ionApp.style.height = ''; - }); - }); - } -}; - -let resizerObserver; - -document.addEventListener('DOMContentLoaded', () => { - if (!window) { - return; - } - - if ('ResizeObserver' in window) { - const ResizeObserver = (window as any).ResizeObserver; - resizerObserver = new ResizeObserver(hack); - resizerObserver.observe(document.documentElement); - } else { - window.addEventListener('keyboardWillShow', hack); - window.addEventListener('keyboardWillHide', hack); - window.addEventListener('resize', hack); - } -}); - -window.addEventListener('unload', () => { - if (!window) { - return; - } - - if ('ResizeObserver' in window) { - if (resizerObserver) { - resizerObserver.unobserve(document.documentElement); - resizerObserver.disconnect(); - } - } else { - window.removeEventListener('keyboardWillShow', hack); - window.removeEventListener('keyboardWillHide', hack); - window.removeEventListener('resize', hack); - } -}); diff --git a/studio/src/global/app.ts b/studio/src/global/app.ts index 0307ee4f0..af0e9e8eb 100644 --- a/studio/src/global/app.ts +++ b/studio/src/global/app.ts @@ -72,54 +72,3 @@ log.apply(console, ['%cDeckDeckGo', 'color: #3880ff;font-size:2rem;font-weight: log.apply(console, ['%cHey there, interested by our code? Lucky you, we are open source :)', 'color: black;font-size:1rem;font-weight: 300;']); log.apply(console, ['%cCome say hi and contribute to our project on Github', 'color: black;font-size:1rem;font-weight: 300;']); log.apply(console, ['%chttps://github.com/deckgo/deckdeckgo', 'font-size:1rem;font-weight: 300;']); - -// https://github.com/deckgo/deckdeckgo/issues/327 -// https://github.com/ionic-team/ionic/issues/19065 - -const hack = () => { - const ionApp = document.querySelector('ion-app'); - - if (ionApp) { - window.requestAnimationFrame(() => { - ionApp.style.height = '100%'; - window.requestAnimationFrame(() => { - ionApp.style.height = ''; - }); - }); - } -}; - -let resizerObserver; - -document.addEventListener('DOMContentLoaded', () => { - if (!window) { - return; - } - - if ('ResizeObserver' in window) { - const ResizeObserver = (window as any).ResizeObserver; - resizerObserver = new ResizeObserver(hack); - resizerObserver.observe(document.documentElement); - } else { - window.addEventListener('keyboardWillShow', hack); - window.addEventListener('keyboardWillHide', hack); - window.addEventListener('resize', hack); - } -}); - -window.addEventListener('unload', () => { - if (!window) { - return; - } - - if ('ResizeObserver' in window) { - if (resizerObserver) { - resizerObserver.unobserve(document.documentElement); - resizerObserver.disconnect(); - } - } else { - window.removeEventListener('keyboardWillShow', hack); - window.removeEventListener('keyboardWillHide', hack); - window.removeEventListener('resize', hack); - } -});