automatically add waves effect to buttons

This commit is contained in:
buzzcode2007 2024-04-01 16:07:51 +08:00
parent 65e8b9686b
commit 0eae6e0368
2 changed files with 21 additions and 3 deletions

View file

@ -89,7 +89,6 @@
title-for="settings_filters_update" title-for="settings_filters_update"
data-enable="filters" data-enable="filters"
data-icon="refresh" data-icon="refresh"
class="btn waves-effect"
></button> ></button>
<button <button
href="settings/filters.htm" href="settings/filters.htm"
@ -97,7 +96,6 @@
tab-width="1080" tab-width="1080"
data-icon="pencil" data-icon="pencil"
title-for="settings_filters_open" title-for="settings_filters_open"
class="btn waves-effect"
></button> ></button>
</side> </side>
</section> </section>
@ -184,7 +182,7 @@
href="help" href="help"
tab-height="607.5" tab-height="607.5"
tab-width="1080" tab-width="1080"
class="btn-floating btn-large waves-effect" class="btn-floating btn-large"
title-for="help" title-for="help"
data-icon="help" data-icon="help"
></button> ></button>

View file

@ -78,6 +78,25 @@ class windowman {
/* Fill in data and events. */ /* Fill in data and events. */
function appearance() { 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() { function icons() {
let target_elements = document.querySelectorAll(`[data-icon]`); let target_elements = document.querySelectorAll(`[data-icon]`);
@ -204,6 +223,7 @@ class windowman {
}); });
} }
elements();
text(); text();
icons(); icons();
storage(); storage();