From 7e82cc5ffd82c695b1556b2ee25e86ddfbcb4e15 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Thu, 19 Oct 2023 18:15:51 +0100 Subject: [PATCH] Fix recursion error when toggling/resizing sidebar in reader window Fixes #3379 --- chrome/content/zotero/xpcom/reader.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index ce2657d18d..fb3a0eccb9 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -329,13 +329,13 @@ class ReaderInstance { } }, onToggleSidebar: (open) => { - if (this._onToggleSidebar) { - this._onToggleSidebar(open); + if (this._onToggleSidebarCallback) { + this._onToggleSidebarCallback(open); } }, onChangeSidebarWidth: (width) => { - if (this._onChangeSidebarWidth) { - this._onChangeSidebarWidth(width); + if (this._onChangeSidebarWidthCallback) { + this._onChangeSidebarWidthCallback(width); } }, onFocusSplitButton: () => { @@ -993,8 +993,8 @@ class ReaderTab extends ReaderInstance { this._sidebarOpen = options.sidebarOpen; this._bottomPlaceholderHeight = options.bottomPlaceholderHeight; this._showItemPaneToggle = true; - this._onToggleSidebar = options.onToggleSidebar; - this._onChangeSidebarWidth = options.onChangeSidebarWidth; + this._onToggleSidebarCallback = options.onToggleSidebar; + this._onChangeSidebarWidthCallback = options.onChangeSidebarWidth; this._window = Services.wm.getMostRecentWindow('navigator:browser'); let { id, container } = this._window.Zotero_Tabs.add({ id: options.tabID,