Skip to content

Always remove the sidebarMoving CSS class when the sidebar is closed #14770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions web/pdf_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";
* @typedef {Object} PDFSidebarElements
* @property {HTMLDivElement} outerContainer - The outer container
* (encasing both the viewer and sidebar elements).
* @property {HTMLDivElement} viewerContainer - The viewer container
* (in which the viewer element is placed).
* @property {HTMLDivElement} sidebarContainer - The sidebar container
* (in which the views are placed).
* @property {HTMLButtonElement} toggleButton - The button used for
* opening/closing the sidebar.
* @property {HTMLButtonElement} thumbnailButton - The button used to show
Expand Down Expand Up @@ -79,7 +79,7 @@ class PDFSidebar {
this.pdfThumbnailViewer = pdfThumbnailViewer;

this.outerContainer = elements.outerContainer;
this.viewerContainer = elements.viewerContainer;
this.sidebarContainer = elements.sidebarContainer;
this.toggleButton = elements.toggleButton;

this.thumbnailButton = elements.thumbnailButton;
Expand Down Expand Up @@ -369,8 +369,8 @@ class PDFSidebar {
* @private
*/
_addEventListeners() {
this.viewerContainer.addEventListener("transitionend", evt => {
if (evt.target === this.viewerContainer) {
this.sidebarContainer.addEventListener("transitionend", evt => {
if (evt.target === this.sidebarContainer) {
this.outerContainer.classList.remove("sidebarMoving");
}
});
Expand Down
2 changes: 1 addition & 1 deletion web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function getViewerConfiguration() {
sidebar: {
// Divs (and sidebar button)
outerContainer: document.getElementById("outerContainer"),
viewerContainer: document.getElementById("viewerContainer"),
sidebarContainer: document.getElementById("sidebarContainer"),
toggleButton: document.getElementById("sidebarToggle"),
// Buttons
thumbnailButton: document.getElementById("viewThumbnail"),
Expand Down