diff --git a/index.html b/index.html index 333669f..fb74c15 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,6 @@ - @@ -19,6 +18,7 @@ - + + diff --git a/src/js/index.ts b/src/js/index.ts index 25b4a21..41edca9 100644 --- a/src/js/index.ts +++ b/src/js/index.ts @@ -1,19 +1,10 @@ -function ready(): Promise { - return new Promise(resolve => { - if (document.readyState === 'complete' || document.readyState === 'interactive') { - resolve() - } else { - document.addEventListener('DOMContentLoaded', () => resolve()) - } - }) -} - -await ready() const fullScreenButton = document.querySelector('button') const input = document.querySelector('textarea') -fullScreenButton?.addEventListener('click', async () => { - await input?.requestFullscreen() - input?.focus() -}) +if (!fullScreenButton.invokeTargetElement) { + fullScreenButton?.addEventListener('click', async () => { + await input?.requestFullscreen() + input?.focus() + }) +} export {}