Update how navigation sidebar visibility is controlled (#1221)
This commit is contained in:
parent
1614335bb0
commit
7f07b905ab
@ -63,7 +63,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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-inner">
|
||||||
<div class="content-sidebar-top-pre">
|
<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>
|
<button class="sidebar-button danger" id="close-button" title="Close popup"><span class="sidebar-button-icon" data-icon="cross"></span></button>
|
||||||
|
@ -382,13 +382,10 @@ a {
|
|||||||
background-color: var(--sidebar-background-color);
|
background-color: var(--sidebar-background-color);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.content-sidebar[hidden] {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.content-sidebar[hidden][data-has-navigation-previous=true],
|
:root[data-has-navigation-previous=true] .content-sidebar,
|
||||||
.content-sidebar[hidden][data-has-navigation-next=true],
|
:root[data-has-navigation-next=true] .content-sidebar,
|
||||||
:root[data-popup-action-bar-visibility=always] .content-sidebar,
|
:root[data-popup-action-bar-visibility=always] .content-sidebar,
|
||||||
:root[data-profile-panel-visible=true] .content-sidebar {
|
:root[data-profile-panel-visible=true] .content-sidebar {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -97,7 +97,6 @@ class Display extends EventDispatcher {
|
|||||||
this._contentScrollElement = document.querySelector('#content-scroll');
|
this._contentScrollElement = document.querySelector('#content-scroll');
|
||||||
this._contentScrollBodyElement = document.querySelector('#content-body');
|
this._contentScrollBodyElement = document.querySelector('#content-body');
|
||||||
this._windowScroll = new WindowScroll(this._contentScrollElement);
|
this._windowScroll = new WindowScroll(this._contentScrollElement);
|
||||||
this._contentSidebar = document.querySelector('#content-sidebar');
|
|
||||||
this._closeButton = document.querySelector('#close-button');
|
this._closeButton = document.querySelector('#close-button');
|
||||||
this._navigationPreviousButton = document.querySelector('#navigate-previous-button');
|
this._navigationPreviousButton = document.querySelector('#navigate-previous-button');
|
||||||
this._navigationNextButton = document.querySelector('#navigate-next-button');
|
this._navigationNextButton = document.querySelector('#navigate-next-button');
|
||||||
@ -1074,9 +1073,10 @@ class Display extends EventDispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateNavigation(previous, next) {
|
_updateNavigation(previous, next) {
|
||||||
if (this._contentSidebar !== null) {
|
const {documentElement} = document;
|
||||||
this._contentSidebar.dataset.hasNavigationPrevious = `${previous}`;
|
if (documentElement !== null) {
|
||||||
this._contentSidebar.dataset.hasNavigationNext = `${next}`;
|
documentElement.dataset.hasNavigationPrevious = `${previous}`;
|
||||||
|
documentElement.dataset.hasNavigationNext = `${next}`;
|
||||||
}
|
}
|
||||||
if (this._navigationPreviousButton !== null) {
|
if (this._navigationPreviousButton !== null) {
|
||||||
this._navigationPreviousButton.disabled = !previous;
|
this._navigationPreviousButton.disabled = !previous;
|
||||||
|
Loading…
Reference in New Issue
Block a user