Fix refocusing of Quick Format window on Linux
This commit is contained in:
parent
6c6505a7ba
commit
189b3cd146
1 changed files with 22 additions and 8 deletions
|
@ -717,13 +717,13 @@ var Zotero_QuickFormat = new function () {
|
|||
if(numReferences || numSeparators) {
|
||||
if(((!referenceHeight && firstReference) || (!separatorHeight && firstSeparator))
|
||||
&& !panelShowing) {
|
||||
referencePanel.openPopup(document.documentElement, "after_start", 15,
|
||||
null, false, false, null);
|
||||
_openReferencePanel();
|
||||
if(!Zotero.isFx4) {
|
||||
window.setTimeout(function() {
|
||||
referencePanel.addEventListener("popupshown", function() {
|
||||
referencePanel.removeEventListener("popupshown", arguments.callee, false);
|
||||
panelShowing = true;
|
||||
_resize();
|
||||
}, 0);
|
||||
}, false);
|
||||
return;
|
||||
} else {
|
||||
panelShowing = true;
|
||||
|
@ -741,15 +741,29 @@ var Zotero_QuickFormat = new function () {
|
|||
}
|
||||
|
||||
referencePanel.sizeTo(window.outerWidth-30,
|
||||
numReferences*referenceHeight+1+numSeparators*separatorHeight-1);
|
||||
if(!panelShowing) referencePanel.openPopup(document.documentElement, "after_start", 15,
|
||||
null, false, false, null);
|
||||
numReferences*referenceHeight+numSeparators*separatorHeight);
|
||||
if(!panelShowing) _openReferencePanel();
|
||||
} else if(panelShowing) {
|
||||
referencePanel.hidePopup();
|
||||
referencePanel.sizeTo(window.outerWidth-30, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the reference panel and potentially refocuses the main text box
|
||||
*/
|
||||
function _openReferencePanel() {
|
||||
referencePanel.openPopup(document.documentElement, "after_start", 15,
|
||||
null, false, false, null);
|
||||
if(!Zotero.isMac && !Zotero.isWin) {
|
||||
// When it opens, we will lose focus
|
||||
referencePanel.addEventListener("popupshown", function() {
|
||||
referencePanel.removeEventListener("popupshown", arguments.callee, false);
|
||||
_refocusQfe();
|
||||
}, false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears all citations
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue