From 5f6d6da1544e88b78d1c3422bb2f8ef8dc09c246 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Wed, 6 Jul 2022 11:30:18 +0300 Subject: [PATCH] Fix disabled "Add to Note" when a child note is open Fixes #2687 --- chrome/content/zotero/contextPane.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/contextPane.js b/chrome/content/zotero/contextPane.js index b9d68e72e3..9d908b6afc 100644 --- a/chrome/content/zotero/contextPane.js +++ b/chrome/content/zotero/contextPane.js @@ -276,9 +276,14 @@ var ZoteroContextPane = new function () { if (splitter.getAttribute('state') != 'collapsed') { if (_panesDeck.selectedIndex == 1) { - var node = _notesPaneDeck.selectedPanel; - if (node.selectedIndex == 1) { - return node.querySelector('note-editor'); + var libraryContext = _notesPaneDeck.selectedPanel; + // Global note + if (libraryContext.selectedIndex == 1) { + return libraryContext.querySelector('note-editor'); + } + // Tab specific child note + else if (libraryContext.selectedIndex == 2) { + return libraryContext.querySelector('.zotero-context-pane-tab-notes-deck').selectedPanel.querySelector('zoteronoteeditor'); } } }