From 0eae6e0368520fca3737c335777bc1d38d70c016 Mon Sep 17 00:00:00 2001 From: buzzcode2007 <73412182+buzz_lightsnack_2007@users.noreply.github.com> Date: Mon, 1 Apr 2024 16:07:51 +0800 Subject: [PATCH] automatically add waves effect to buttons --- gui/pages/settings.htm | 4 +--- gui/scripts/windowman.JS | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/gui/pages/settings.htm b/gui/pages/settings.htm index c17c83b..78f8fe4 100644 --- a/gui/pages/settings.htm +++ b/gui/pages/settings.htm @@ -89,7 +89,6 @@ title-for="settings_filters_update" data-enable="filters" data-icon="refresh" - class="btn waves-effect" > @@ -184,7 +182,7 @@ href="help" tab-height="607.5" tab-width="1080" - class="btn-floating btn-large waves-effect" + class="btn-floating btn-large" title-for="help" data-icon="help" > diff --git a/gui/scripts/windowman.JS b/gui/scripts/windowman.JS index 4a0cc56..5ce6d6e 100644 --- a/gui/scripts/windowman.JS +++ b/gui/scripts/windowman.JS @@ -78,6 +78,25 @@ class windowman { /* Fill in data and events. */ function appearance() { + // Add missing classes to all elements. + function elements() { + // Add buttons elements. + function buttons() { + document.querySelectorAll(`button`).forEach((button) => { + if (!button.classList.contains(`btn`)) { + button.classList.add(`btn`); + } + if (!button.classList.contains(`waves-effect`)) { + button.classList.add(`waves-effect`); + } + }) + + + } + buttons(); + } + + function icons() { let target_elements = document.querySelectorAll(`[data-icon]`); @@ -204,6 +223,7 @@ class windowman { }); } + elements(); text(); icons(); storage();