commit 80008fd13de843ad7f6ce453aa0fa0734d10a836 parent d9b5e17c9cc5cf125561550ff8054818d3a73201 Author: Dan Stillman <dstillman@zotero.org> Date: Tue, 29 Sep 2015 03:47:54 -0400 Pass tabIndex param to pref window to select tab within specified pane Diffstat:
| M | chrome/content/zotero/preferences/preferences.js | | | 12 | ++++++++++++ |
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js @@ -41,8 +41,20 @@ var Zotero_Preferences = { var io = window.arguments[0]; if(io.pane) { + let tabIndex = io.tabIndex; var pane = document.getElementById(io.pane); document.getElementById('zotero-prefs').showPane(pane); + // Select tab within pane + if (tabIndex !== undefined) { + if (pane.loaded) { + document.getElementsByTagName('tabbox')[0].selectedIndex = tabIndex; + } + else { + pane.addEventListener('paneload', function () { + document.getElementsByTagName('tabbox')[0].selectedIndex = tabIndex; + }) + } + } } } else if(document.location.hash == "#cite") { document.getElementById('zotero-prefs').showPane(document.getElementById("zotero-prefpane-cite"));