restore toolbars properly when Zotero pane is closed
This commit is contained in:
parent
f5b2f77a3a
commit
7f8fe0ce78
1 changed files with 29 additions and 15 deletions
|
@ -90,7 +90,7 @@ var ZoteroPane = new function()
|
||||||
const COLLECTIONS_HEIGHT = 125; // minimum height of the collections pane and toolbar
|
const COLLECTIONS_HEIGHT = 125; // minimum height of the collections pane and toolbar
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var titlebarcolorState, collapseState, titleState;
|
var titlebarcolorState, toolbarCollapseState, titleState;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called when the window is open
|
* Called when the window is open
|
||||||
|
@ -360,6 +360,9 @@ var ZoteroPane = new function()
|
||||||
|
|
||||||
document.getElementById('content').setAttribute('collapsed', false);
|
document.getElementById('content').setAttribute('collapsed', false);
|
||||||
|
|
||||||
|
// turn off full window mode, if it was on
|
||||||
|
_setFullWindowMode(false)
|
||||||
|
|
||||||
// Return focus to the browser content pane
|
// Return focus to the browser content pane
|
||||||
window.content.window.focus();
|
window.content.window.focus();
|
||||||
}
|
}
|
||||||
|
@ -390,12 +393,18 @@ var ZoteroPane = new function()
|
||||||
document.getElementById('zotero-splitter').setAttribute('hidden', makeFullScreen);
|
document.getElementById('zotero-splitter').setAttribute('hidden', makeFullScreen);
|
||||||
fs.setAttribute('fullscreenmode', makeFullScreen);
|
fs.setAttribute('fullscreenmode', makeFullScreen);
|
||||||
|
|
||||||
|
_setFullWindowMode(makeFullScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hides or shows navigation toolbars
|
||||||
|
* @param set {Boolean} Whether navigation toolbars should be hidden or shown
|
||||||
|
*/
|
||||||
|
function _setFullWindowMode(set) {
|
||||||
// hide or show navigation toolbars
|
// hide or show navigation toolbars
|
||||||
var toolbox = getNavToolbox();
|
var toolbox = getNavToolbox();
|
||||||
if(makeFullScreen) {
|
Zotero.debug(toolbarCollapseState);
|
||||||
titleState = document.title;
|
if(set) {
|
||||||
document.title = "Zotero";
|
|
||||||
|
|
||||||
// the below would be a good thing to do if the whole title bar (and not just the center
|
// the below would be a good thing to do if the whole title bar (and not just the center
|
||||||
// part) got updated when it happened...
|
// part) got updated when it happened...
|
||||||
/*if(Zotero.isMac) {
|
/*if(Zotero.isMac) {
|
||||||
|
@ -403,28 +412,33 @@ var ZoteroPane = new function()
|
||||||
document.documentElement.removeAttribute("activetitlebarcolor");
|
document.documentElement.removeAttribute("activetitlebarcolor");
|
||||||
}*/
|
}*/
|
||||||
if(Zotero.isMac) document.getElementById("zotero-pane").style.borderTop = "1px solid black";
|
if(Zotero.isMac) document.getElementById("zotero-pane").style.borderTop = "1px solid black";
|
||||||
|
if(document.title != "Zotero") {
|
||||||
collapseState = [node.collapsed for each (node in toolbox.childNodes)];
|
titleState = document.title;
|
||||||
for(var i=0; i<toolbox.childNodes.length; i++) {
|
document.title = "Zotero";
|
||||||
toolbox.childNodes[i].collapsed = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.focus();
|
if(!toolbarCollapseState) {
|
||||||
|
toolbarCollapseState = [node.collapsed for each (node in toolbox.childNodes)];
|
||||||
|
for(var i=0; i<toolbox.childNodes.length; i++) {
|
||||||
|
toolbox.childNodes[i].collapsed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
document.title = titleState;
|
|
||||||
|
|
||||||
/*if(Zotero.isMac) {
|
/*if(Zotero.isMac) {
|
||||||
document.documentElement.setAttribute("activetitlebarcolor", titlebarcolorState);
|
document.documentElement.setAttribute("activetitlebarcolor", titlebarcolorState);
|
||||||
}*/
|
}*/
|
||||||
if(Zotero.isMac) document.getElementById("zotero-pane").style.borderTop = "";
|
if(Zotero.isMac) document.getElementById("zotero-pane").style.borderTop = "";
|
||||||
|
if(document.title == "Zotero") document.title = titleState;
|
||||||
|
|
||||||
for(var i=0; i<toolbox.childNodes.length; i++) {
|
if(toolbarCollapseState) {
|
||||||
toolbox.childNodes[i].collapsed = collapseState[i];
|
for(var i=0; i<toolbox.childNodes.length; i++) {
|
||||||
|
toolbox.childNodes[i].collapsed = toolbarCollapseState[i];
|
||||||
|
}
|
||||||
|
toolbarCollapseState = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function isFullScreen() {
|
function isFullScreen() {
|
||||||
var fs = document.getElementById('zotero-tb-fullscreen');
|
var fs = document.getElementById('zotero-tb-fullscreen');
|
||||||
return fs.getAttribute('fullscreenmode') == 'true'
|
return fs.getAttribute('fullscreenmode') == 'true'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue