Browse Source

feat(toolbar/status): dismiss statusbar on document scroll

Josh Habdas 10 months ago
parent
commit
243c9d035d
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      layouts/partials/modules/toxic-swamp/toolbar.html

+ 9
- 0
layouts/partials/modules/toxic-swamp/toolbar.html View File

@@ -280,6 +280,15 @@
280 280
           isMinerActive
281 281
             ? form.classList.toggle('-disclosed')
282 282
             : form.classList.remove('-disclosed');
283
+          const isDisclosed = form.classList.contains('-disclosed');
284
+          if (isMinerActive && isDisclosed) {
285
+            const { defaultView } = document;
286
+            const handler = () => requestAnimationFrame(() => {
287
+              isDisclosed && form.classList.remove('-disclosed');
288
+              defaultView.removeEventListener('scroll', handler);
289
+            });
290
+            defaultView.addEventListener('scroll', handler);
291
+          }
283 292
         }
284 293
         static registerListeners () {
285 294
           form.addEventListener(

Loading…
Cancel
Save