From c21a01ad864df267f705d2c6c5bd59655a320706 Mon Sep 17 00:00:00 2001 From: Pavel Tatarskiy Date: Fri, 13 Sep 2024 14:41:40 +0300 Subject: [PATCH] remove unused code (closable moved to progressLog) --- assets/src/js/app/action.js | 5 ----- assets/src/js/app/auth/login.js | 5 ----- assets/src/js/app/index.js | 6 ------ assets/src/js/app/layout.js | 2 -- assets/src/js/lib/closeable.js | 11 ----------- 5 files changed, 29 deletions(-) delete mode 100644 assets/src/js/lib/closeable.js diff --git a/assets/src/js/app/action.js b/assets/src/js/app/action.js index 0189d11..8d23ae3 100644 --- a/assets/src/js/app/action.js +++ b/assets/src/js/app/action.js @@ -4,11 +4,6 @@ av(target, 'action/post', async function() { const self = this; const progress = self.querySelector('form'); const el = document.createElement('div'); - const closeable = target.querySelector('.closeable'); - if (closeable) { - const initCloseable = (await import('../lib/closeable')).initCloseable; - initCloseable(closeable); - } const initProgressLog = (await import('../lib/progressLog')).initProgressLog; initProgressLog(progress, function(ev) { if (ev.level !== 'rendertemplate') return; diff --git a/assets/src/js/app/auth/login.js b/assets/src/js/app/auth/login.js index ad79cf8..1b4887f 100644 --- a/assets/src/js/app/auth/login.js +++ b/assets/src/js/app/auth/login.js @@ -5,11 +5,6 @@ window.submitLoginForm = function(target, e) { pl.clear(); const e = pl.inProgress('login','sending magic link to ' + data.email); const supertokens = (await import('../../lib/supertokens')); - const closeable = document.querySelector('.closeable'); - if (closeable) { - const initCloseable = (await import('../../lib/closeable')).initCloseable; - initCloseable(closeable); - } try { await supertokens.sendMagicLink(data, window._CSRF); e.done('magic link sent to ' + data.email); diff --git a/assets/src/js/app/index.js b/assets/src/js/app/index.js index ea87c32..4d3807a 100644 --- a/assets/src/js/app/index.js +++ b/assets/src/js/app/index.js @@ -6,12 +6,6 @@ av(target, 'index', async function() { const initDrop = (await import('../lib/drop')).initDrop; initDrop(dropzone); } - - const closeable = target.querySelector('.closeable'); - if (closeable) { - const initCloseable = (await import('../lib/closeable')).initCloseable; - initCloseable(closeable); - } const progress = this.querySelector('.progress-alert'); if (progress != null) { const initProgressLog = (await import('../lib/progressLog')).initProgressLog; diff --git a/assets/src/js/app/layout.js b/assets/src/js/app/layout.js index 183a3b7..7f2046d 100644 --- a/assets/src/js/app/layout.js +++ b/assets/src/js/app/layout.js @@ -7,8 +7,6 @@ function hideProgress() { progress.classList.add('hidden'); } - - window.progress = { show: showProgress, hide: hideProgress, diff --git a/assets/src/js/lib/closeable.js b/assets/src/js/lib/closeable.js deleted file mode 100644 index 0176669..0000000 --- a/assets/src/js/lib/closeable.js +++ /dev/null @@ -1,11 +0,0 @@ -export function initCloseable(target) { - const closeButton = target.querySelector('.closeable-close'); - if (!closeButton) { - return; - } - closeButton.addEventListener('click', function(e) { - target.classList.remove('popin'); - // alert.classList.add('opacity-0'); - setTimeout(() => { target.classList.add('hidden')}, 200); - }); -} \ No newline at end of file