aboutsummaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-10 16:48:31 -0500
committerGitHub <noreply@github.com>2021-01-10 16:48:31 -0500
commit7f07b905abc42c10b8b71a06a60561bc169e851a (patch)
tree907782b91ddbab2328073b6325f553cfbcc16ab7 /ext
parent1614335bb005ee1b9df4c6f63725bc505dfb4588 (diff)
Update how navigation sidebar visibility is controlled (#1221)
Diffstat (limited to 'ext')
-rw-r--r--ext/fg/float.html2
-rw-r--r--ext/mixed/css/display.css7
-rw-r--r--ext/mixed/js/display.js8
3 files changed, 7 insertions, 10 deletions
diff --git a/ext/fg/float.html b/ext/fg/float.html
index e4f30d83..ccf9b99a 100644
--- a/ext/fg/float.html
+++ b/ext/fg/float.html
@@ -63,7 +63,7 @@
</div>
</div>
</div>
- <div class="content-sidebar scrollbar" id="content-sidebar" hidden>
+ <div class="content-sidebar scrollbar" id="content-sidebar">
<div class="content-sidebar-inner">
<div class="content-sidebar-top-pre">
<button class="sidebar-button danger" id="close-button" title="Close popup"><span class="sidebar-button-icon" data-icon="cross"></span></button>
diff --git a/ext/mixed/css/display.css b/ext/mixed/css/display.css
index 6bea1ad2..a7c3e368 100644
--- a/ext/mixed/css/display.css
+++ b/ext/mixed/css/display.css
@@ -382,13 +382,10 @@ a {
background-color: var(--sidebar-background-color);
z-index: 10;
position: relative;
- display: block;
-}
-.content-sidebar[hidden] {
display: none;
}
-.content-sidebar[hidden][data-has-navigation-previous=true],
-.content-sidebar[hidden][data-has-navigation-next=true],
+:root[data-has-navigation-previous=true] .content-sidebar,
+:root[data-has-navigation-next=true] .content-sidebar,
:root[data-popup-action-bar-visibility=always] .content-sidebar,
:root[data-profile-panel-visible=true] .content-sidebar {
display: block;
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 2b3ea21c..b43b4dca 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -97,7 +97,6 @@ class Display extends EventDispatcher {
this._contentScrollElement = document.querySelector('#content-scroll');
this._contentScrollBodyElement = document.querySelector('#content-body');
this._windowScroll = new WindowScroll(this._contentScrollElement);
- this._contentSidebar = document.querySelector('#content-sidebar');
this._closeButton = document.querySelector('#close-button');
this._navigationPreviousButton = document.querySelector('#navigate-previous-button');
this._navigationNextButton = document.querySelector('#navigate-next-button');
@@ -1074,9 +1073,10 @@ class Display extends EventDispatcher {
}
_updateNavigation(previous, next) {
- if (this._contentSidebar !== null) {
- this._contentSidebar.dataset.hasNavigationPrevious = `${previous}`;
- this._contentSidebar.dataset.hasNavigationNext = `${next}`;
+ const {documentElement} = document;
+ if (documentElement !== null) {
+ documentElement.dataset.hasNavigationPrevious = `${previous}`;
+ documentElement.dataset.hasNavigationNext = `${next}`;
}
if (this._navigationPreviousButton !== null) {
this._navigationPreviousButton.disabled = !previous;