-
Notifications
You must be signed in to change notification settings - Fork 11
/
ToggleRightPane
34 lines (29 loc) · 901 Bytes
/
ToggleRightPane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Toggle Right Pane
* @author [MuiseDestiny](https://github.com/MuiseDestiny), windingwind
* @usage Assign a shortcut
* @link https://github.com/windingwind/zotero-actions-tags/discussions/169
* @see https://github.com/windingwind/zotero-actions-tags/discussions/169
*
* [Toggle Right Pane]
* Name : Toggle Right Pane
* Event : None
* Operation : Script
* Data : JS code below
* Shortcut : Shift + ]
*/
const Zotero = require("Zotero");
const Zotero_Tabs = require("Zotero_Tabs");
const document = require("document");
const DEFAULT_OPEN_PANE = "item";
if (item) {
return;
}
const splitter = document.querySelector(Zotero_Tabs.selectedType === "library" ? "#zotero-items-splitter":"#zotero-context-splitter");
if (splitter.getAttribute("state") == "collapsed") {
splitter.setAttribute("state", "");
return;
} else {
splitter.setAttribute("state", "collapsed");
return;
}