Skip to content

Commit

Permalink
Display hide hint text when admonition is expanded (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabalafou authored Dec 22, 2023
1 parent 0a356c2 commit f468ca6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sphinx_togglebutton/_static/togglebutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ button.toggle-button {

/* Display the toggle hint on wide screens */
@media (min-width: 768px) {
button.toggle-button.toggle-button-hidden:before {
button.toggle-button:before {
content: attr(data-toggle-hint); /* This will be filled in by JS */
font-size: .8em;
align-self: center;
Expand Down
2 changes: 2 additions & 0 deletions sphinx_togglebutton/_static/togglebutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,11 @@ var toggleHidden = (button) => {
if (itemToToggle.classList.contains("toggle-hidden")) {
itemToToggle.classList.remove("toggle-hidden");
button.classList.remove("toggle-button-hidden");
button.dataset.toggleHint = toggleHintHide;
} else {
itemToToggle.classList.add("toggle-hidden");
button.classList.add("toggle-button-hidden");
button.dataset.toggleHint = toggleHintShow;
}
}

Expand Down

0 comments on commit f468ca6

Please sign in to comment.