parent
a418d5ae8d
commit
a5fe49b866
7 changed files with 18 additions and 38 deletions
|
@ -44,12 +44,10 @@ var ZoteroContextPane = new function () {
|
||||||
var _itemPaneDeck;
|
var _itemPaneDeck;
|
||||||
var _notesPaneDeck;
|
var _notesPaneDeck;
|
||||||
|
|
||||||
var _itemToolbar;
|
|
||||||
var _splitButton;
|
var _splitButton;
|
||||||
var _itemPaneToggle;
|
var _itemPaneToggle;
|
||||||
var _notesPaneToggle;
|
var _notesPaneToggle;
|
||||||
var _toolbar;
|
var _tabToolbar;
|
||||||
var _tabToolbarContainer;
|
|
||||||
|
|
||||||
var _itemContexts = [];
|
var _itemContexts = [];
|
||||||
var _notesContexts = [];
|
var _notesContexts = [];
|
||||||
|
@ -73,19 +71,17 @@ var ZoteroContextPane = new function () {
|
||||||
_contextPaneSplitter = document.getElementById('zotero-context-splitter');
|
_contextPaneSplitter = document.getElementById('zotero-context-splitter');
|
||||||
_contextPaneSplitterStacked = document.getElementById('zotero-context-splitter-stacked');
|
_contextPaneSplitterStacked = document.getElementById('zotero-context-splitter-stacked');
|
||||||
|
|
||||||
_itemToolbar = document.getElementById('zotero-item-toolbar');
|
|
||||||
_splitButton = document.getElementById('zotero-tb-split');
|
_splitButton = document.getElementById('zotero-tb-split');
|
||||||
_itemPaneToggle = document.getElementById('zotero-tb-toggle-item-pane');
|
_itemPaneToggle = document.getElementById('zotero-tb-toggle-item-pane');
|
||||||
_notesPaneToggle = document.getElementById('zotero-tb-toggle-notes-pane');
|
_notesPaneToggle = document.getElementById('zotero-tb-toggle-notes-pane');
|
||||||
_toolbar = document.getElementById('zotero-toolbar');
|
_tabToolbar = document.getElementById('zotero-tab-toolbar');
|
||||||
_tabToolbarContainer = document.getElementById('zotero-tab-toolbar-container');
|
|
||||||
|
|
||||||
if (Zotero.rtl) {
|
if (Zotero.rtl) {
|
||||||
_tabToolbarContainer.style.left = 0;
|
_tabToolbar.style.left = 0;
|
||||||
_splitButton.style.transform = 'scaleX(-1)';
|
_splitButton.style.transform = 'scaleX(-1)';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_tabToolbarContainer.style.right = 0;
|
_tabToolbar.style.right = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_init();
|
_init();
|
||||||
|
@ -96,13 +92,6 @@ var ZoteroContextPane = new function () {
|
||||||
_notesToggle.addEventListener('click', _toggleNotesButton);
|
_notesToggle.addEventListener('click', _toggleNotesButton);
|
||||||
Zotero.Reader.onChangeSidebarWidth = _updatePaneWidth;
|
Zotero.Reader.onChangeSidebarWidth = _updatePaneWidth;
|
||||||
Zotero.Reader.onChangeSidebarOpen = _updatePaneWidth;
|
Zotero.Reader.onChangeSidebarOpen = _updatePaneWidth;
|
||||||
|
|
||||||
this._mutationObserver = new MutationObserver(() => {
|
|
||||||
_updateToolbarWidth();
|
|
||||||
// Sometimes XUL is late to reflow
|
|
||||||
setTimeout(_updateToolbarWidth, 100);
|
|
||||||
});
|
|
||||||
this._mutationObserver.observe(_tabToolbarContainer, { attributes: true, childList: true, subtree: true });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onUnload = function () {
|
this.onUnload = function () {
|
||||||
|
@ -110,7 +99,6 @@ var ZoteroContextPane = new function () {
|
||||||
_notesToggle.removeEventListener('click', _toggleNotesButton);
|
_notesToggle.removeEventListener('click', _toggleNotesButton);
|
||||||
window.removeEventListener('resize', _update);
|
window.removeEventListener('resize', _update);
|
||||||
Zotero.Notifier.unregisterObserver(this._notifierID);
|
Zotero.Notifier.unregisterObserver(this._notifierID);
|
||||||
this._mutationObserver.disconnect();
|
|
||||||
Zotero.Reader.onChangeSidebarWidth = () => {};
|
Zotero.Reader.onChangeSidebarWidth = () => {};
|
||||||
Zotero.Reader.onChangeSidebarOpen = () => {};
|
Zotero.Reader.onChangeSidebarOpen = () => {};
|
||||||
_contextPaneInner.innerHTML = '';
|
_contextPaneInner.innerHTML = '';
|
||||||
|
@ -170,9 +158,7 @@ var ZoteroContextPane = new function () {
|
||||||
if (Zotero_Tabs.selectedIndex == 0) {
|
if (Zotero_Tabs.selectedIndex == 0) {
|
||||||
_contextPaneSplitter.setAttribute('hidden', true);
|
_contextPaneSplitter.setAttribute('hidden', true);
|
||||||
_contextPane.setAttribute('collapsed', true);
|
_contextPane.setAttribute('collapsed', true);
|
||||||
_toolbar.append(_itemToolbar);
|
_tabToolbar.hidden = true;
|
||||||
_itemToolbar.classList.remove('tab-mode');
|
|
||||||
_splitButton.classList.add('hidden');
|
|
||||||
_tabCover.hidden = true;
|
_tabCover.hidden = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -200,9 +186,7 @@ var ZoteroContextPane = new function () {
|
||||||
|
|
||||||
_contextPaneSplitter.setAttribute('hidden', false);
|
_contextPaneSplitter.setAttribute('hidden', false);
|
||||||
_contextPane.setAttribute('collapsed', !(_contextPaneSplitter.getAttribute('state') != 'collapsed'));
|
_contextPane.setAttribute('collapsed', !(_contextPaneSplitter.getAttribute('state') != 'collapsed'));
|
||||||
_tabToolbarContainer.append(_itemToolbar);
|
_tabToolbar.hidden = false;
|
||||||
_itemToolbar.classList.add('tab-mode');
|
|
||||||
_splitButton.classList.remove('hidden');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_selectItemContext(ids[0]);
|
_selectItemContext(ids[0]);
|
||||||
|
@ -279,7 +263,7 @@ var ZoteroContextPane = new function () {
|
||||||
var reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);
|
var reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);
|
||||||
if (reader) {
|
if (reader) {
|
||||||
if ((stacked || _contextPaneSplitter.getAttribute('state') == 'collapsed')) {
|
if ((stacked || _contextPaneSplitter.getAttribute('state') == 'collapsed')) {
|
||||||
reader.setToolbarPlaceholderWidth(_tabToolbarContainer.boxObject.width);
|
reader.setToolbarPlaceholderWidth(_tabToolbar.boxObject.width);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
reader.setToolbarPlaceholderWidth(0);
|
reader.setToolbarPlaceholderWidth(0);
|
||||||
|
|
|
@ -1309,7 +1309,6 @@ Zotero.Sync.Runner_Module = function (options = {}) {
|
||||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||||
.getService(Components.interfaces.nsIWindowMediator);
|
.getService(Components.interfaces.nsIWindowMediator);
|
||||||
var win = wm.getMostRecentWindow("navigator:browser");
|
var win = wm.getMostRecentWindow("navigator:browser");
|
||||||
win.Zotero_Tabs.select('zotero-pane');
|
|
||||||
win.ZoteroPane.selectItem(object.id);
|
win.ZoteroPane.selectItem(object.id);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,12 @@
|
||||||
<box id="zotero-tab-cover" hidden="true">
|
<box id="zotero-tab-cover" hidden="true">
|
||||||
<label pack="center">&zotero.general.loading;</label>
|
<label pack="center">&zotero.general.loading;</label>
|
||||||
</box>
|
</box>
|
||||||
<box id="zotero-tab-toolbar-container"/>
|
<box id="zotero-tab-toolbar" class="toolbar" hidden="true">
|
||||||
|
<div id="zotero-tb-split" xmlns="http://www.w3.org/1999/xhtml" class="split-button">
|
||||||
|
<div id="zotero-tb-toggle-item-pane" class="toolbarButton item" title="&zotero.toolbar.context.item;"><span/></div>
|
||||||
|
<div id="zotero-tb-toggle-notes-pane" class="toolbarButton notes" title="&zotero.toolbar.context.notes;"><span/></div>
|
||||||
|
</div>
|
||||||
|
</box>
|
||||||
<deck id="tabs-deck" flex="1">
|
<deck id="tabs-deck" flex="1">
|
||||||
<vbox id="zotero-pane"
|
<vbox id="zotero-pane"
|
||||||
onkeydown="ZoteroPane_Local.handleKeyDown(event, this.id)"
|
onkeydown="ZoteroPane_Local.handleKeyDown(event, this.id)"
|
||||||
|
@ -228,11 +233,6 @@
|
||||||
<div xmlns="http://www.w3.org/1999/xhtml" class="sync-button-tooltip-messages"/>
|
<div xmlns="http://www.w3.org/1999/xhtml" class="sync-button-tooltip-messages"/>
|
||||||
</tooltip>
|
</tooltip>
|
||||||
</toolbarbutton>
|
</toolbarbutton>
|
||||||
|
|
||||||
<div id="zotero-tb-split" xmlns="http://www.w3.org/1999/xhtml" class="split-button hidden">
|
|
||||||
<div id="zotero-tb-toggle-item-pane" class="toolbarButton item" title="&zotero.toolbar.context.item;"><span></span></div>
|
|
||||||
<div id="zotero-tb-toggle-notes-pane" class="toolbarButton notes" title="&zotero.toolbar.context.notes;"><span></span></div>
|
|
||||||
</div>
|
|
||||||
</hbox>
|
</hbox>
|
||||||
</toolbar>
|
</toolbar>
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
/* display: none;*/
|
/* display: none;*/
|
||||||
/*}*/
|
/*}*/
|
||||||
|
|
||||||
#zotero-tab-toolbar-container {
|
#zotero-tab-toolbar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
|
@ -54,11 +54,6 @@
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#zotero-tab-toolbar-container #zotero-tb-locate,
|
|
||||||
#zotero-tab-toolbar-container #zotero-pq-buttons {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#zotero-context-toolbar-extension {
|
#zotero-context-toolbar-extension {
|
||||||
height: 32px;
|
height: 32px;
|
||||||
/* To cover the splitter that has a higher stacking order than our parent */
|
/* To cover the splitter that has a higher stacking order than our parent */
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cff42ffa8f616df41cdd4aec68621a44cee27837
|
Subproject commit f52448994834563569f7a22a44b15f70e2d7474d
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7db07151abe5e67aa03b24b86151816c95bcd865
|
Subproject commit 1d8e8ed20b466963192ebf7aa713c1c97e9d89d7
|
|
@ -232,6 +232,8 @@ $toolbar-btn-icon-active-offset: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.split-button {
|
.split-button {
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue