Pass tabIndex param to pref window to select tab within specified pane
This commit is contained in:
parent
d9b5e17c9c
commit
80008fd13d
1 changed files with 12 additions and 0 deletions
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue