diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js index 4896a243d9..aa61b5104c 100644 --- a/chrome/content/zotero/integration/quickFormat.js +++ b/chrome/content/zotero/integration/quickFormat.js @@ -25,8 +25,8 @@ var Zotero_QuickFormat = new function () { var initialized, io, qfs, qfi, qfiWindow, qfiDocument, qfe, qfb, qfbHeight, keepSorted, - showEditor, referencePanel, referenceBox, referenceHeight, separatorHeight, - currentLocator, currentLocatorLabel, currentIDs = [], currentSearchTime, dragging, panel, + showEditor, referencePanel, referenceBox, referenceHeight = 0, separatorHeight = 0, + currentLocator, currentLocatorLabel, currentSearchTime, dragging, panel, panelPrefix, panelSuffix, panelSuppressAuthor, panelLocatorLabel, panelLocator, panelInfo, panelRefersToBubble; @@ -261,22 +261,6 @@ var Zotero_QuickFormat = new function () { if(haveConditions) { var searchResultIDs = (haveConditions ? s.search() : []); - // No need to refresh anything if box hasn't changed - if(searchResultIDs.length === currentIDs.length) { - var mismatch = false; - for(var i=0; i 30) { qfe.setAttribute("multiline", true); qfs.setAttribute("multiline", true); - qfeHeight = qfe.scrollHeight; - var height = 4+qfeHeight; - - qfs.style.height = height+"px"; + qfs.style.height = (4+qfeHeight)+"px"; window.sizeToContent(); } else { delete qfs.style.height; @@ -737,31 +713,27 @@ var Zotero_QuickFormat = new function () { var panelShowing = referencePanel.state === "open" || referencePanel.state === "showing"; if(numReferences || numSeparators) { - var height = referenceHeight ? - Math.min(numReferences*referenceHeight+1+numSeparators*separatorHeight) : 39; + if(!referenceHeight && firstReference) { + if(!panelShowing) referencePanel.openPopup(document.documentElement, "after_start", 15, + null, false, false, null); + panelShowing = true; + referenceHeight = firstReference.scrollHeight+1; + } - if(panelShowing && height !== referencePanel.clientHeight) { - referencePanel.sizeTo((window.outerWidth-30), height); - /*if(curResizer) curResizer.stop(); - curResizer = new Resizer(referencePanel, null, height, 30, 1000); - curResizer.animate();*/ - } else { - referencePanel.sizeTo((window.outerWidth-30), height); - referencePanel.openPopup(document.documentElement, "after_start", 15, null, - false, false, null); - - if(!referenceHeight) { - separatorHeight = firstSeparator.scrollHeight; - referenceHeight = firstReference.scrollHeight; - height = Math.min(numReferences*referenceHeight+1+numSeparators*separatorHeight); - referencePanel.sizeTo((window.outerWidth-30), height); - } - } - } else { - if(panelShowing) { - referencePanel.hidePopup(); - referencePanel.sizeTo(referencePanel.clientWidth, 0); + if(!separatorHeight && firstSeparator) { + if(!panelShowing) referencePanel.openPopup(document.documentElement, "after_start", 15, + null, false, false, null); + panelShowing = true; + separatorHeight = firstSeparator.scrollHeight+1; } + + referencePanel.sizeTo(window.outerWidth-30, + numReferences*referenceHeight+1+numSeparators*separatorHeight); + if(!panelShowing) referencePanel.openPopup(document.documentElement, "after_start", 15, + null, false, false, null); + } else if(panelShowing) { + referencePanel.hidePopup(); + referencePanel.sizeTo(window.outerWidth-30, 0); } } diff --git a/chrome/content/zotero/integration/quickFormat.xul b/chrome/content/zotero/integration/quickFormat.xul index 7e846e0399..fb5df04eca 100644 --- a/chrome/content/zotero/integration/quickFormat.xul +++ b/chrome/content/zotero/integration/quickFormat.xul @@ -65,7 +65,7 @@ - +