Skip to content

Commit

Permalink
Fix the highlighting of buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
pflooky committed Nov 12, 2023
1 parent cb017c4 commit 48ace3e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
9 changes: 3 additions & 6 deletions docs/javascripts/tableselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ document$.subscribe(function() {
// Toggle the visibility of the column
column.visible(!isColVisible);
// Toggle the highlighting of the button
if (el.classList.contains("md-button-column-visible")) {
el.classList.remove("md-button-column-visible");
} else {
el.classList.add("md-button-column-visible");
}
el.classList.toggle("md-button-selected");
el.blur();
});
});

// Toggle on the visible buttons
document.querySelectorAll(".md-button.toggle-vis").forEach((el) => {
if (parseInt(el.getAttribute("data-column")) < 4) {
el.classList.add("md-button-column-visible");
el.classList.toggle("md-button-selected");
}
});

Expand Down
6 changes: 4 additions & 2 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
font-size: 0.8rem;
}

.md-button-column-visible {
background-color: royalblue;
.md-button-selected, .md-button:focus {
background-color: var(--md-accent-fg-color) !important;
border-color: white !important;
color: var(--md-accent-bg-color) !important;
}
9 changes: 3 additions & 6 deletions site/javascripts/tableselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ document$.subscribe(function() {
// Toggle the visibility of the column
column.visible(!isColVisible);
// Toggle the highlighting of the button
if (el.classList.contains("md-button-column-visible")) {
el.classList.remove("md-button-column-visible");
} else {
el.classList.add("md-button-column-visible");
}
el.classList.toggle("md-button-selected");
el.blur();
});
});

// Toggle on the visible buttons
document.querySelectorAll(".md-button.toggle-vis").forEach((el) => {
if (parseInt(el.getAttribute("data-column")) < 4) {
el.classList.add("md-button-column-visible");
el.classList.toggle("md-button-selected");
}
});

Expand Down
Binary file modified site/sitemap.xml.gz
Binary file not shown.
6 changes: 4 additions & 2 deletions site/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
font-size: 0.8rem;
}

.md-button-column-visible {
background-color: royalblue;
.md-button-selected, .md-button:focus {
background-color: var(--md-accent-fg-color) !important;
border-color: white !important;
color: var(--md-accent-bg-color) !important;
}

0 comments on commit 48ace3e

Please sign in to comment.