- Fix off-center Add Citation window on Windows (for some users since 1.0.4)

- Make Related Items window a real window on OS X
- Persist position of Related Items window
- Allow Escape in empty search field to close Related Items window
This commit is contained in:
Dan Stillman 2008-06-05 00:38:11 +00:00
parent 4d8637bc98
commit 3dc5531176
4 changed files with 28 additions and 7 deletions

View File

@ -110,13 +110,19 @@ var Zotero_File_Interface_Bibliography = new function() {
document.getElementById("fields").label = Zotero.getString("integration."+formatOption+".label");
document.getElementById("fields-caption").textContent = Zotero.getString("integration."+formatOption+".caption");
// add border on Windows
if(Zotero.isWin) {
// add border on Windows
document.getElementById("zotero-doc-prefs-dialog").style.border = "1px solid black";
}
}
window.sizeToContent();
window.centerWindowOnScreen();
// Center popup manually after a delay on Windows, since window
// isn't resizable and there might be a persisted position
if (Zotero.isWin) {
setTimeout(function () {
window.centerWindowOnScreen();
}, 1);
}
}
/*

View File

@ -138,8 +138,12 @@
<body>
<![CDATA[
var io = {dataIn: null, dataOut: null};
window.openDialog('chrome://zotero/content/selectItemsDialog.xul','','chrome,modal',io);
Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(Components.interfaces.nsIWindowWatcher)
.openWindow(null, 'chrome://zotero/content/selectItemsDialog.xul', '',
'chrome,modal,centerscreen', io);
if(io.dataOut && this.item)
{
for(var i = 0; i < io.dataOut.length; i++)

View File

@ -39,6 +39,15 @@ function doLoad()
collectionsView = new Zotero.CollectionTreeView();
document.getElementById('zotero-collections-tree').view = collectionsView;
// Center popup manually after a delay on Windows, since window
// isn't resizable and there might be a persisted position
if (Zotero.isWin &&
window.document.activeElement.id != 'zotero-select-items-dialog') {
setTimeout(function () {
window.centerWindowOnScreen();
}, 1);
}
}
function doUnload()

View File

@ -35,7 +35,8 @@
onload="doLoad();"
onunload="doUnload();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="padding:2em">
style="padding:2em"
persist="screenX screenY">
<script src="include.js"/>
<script src="selectItemsDialog.js"/>
@ -44,7 +45,8 @@
<hbox align="center" pack="end">
<label value="&zotero.toolbar.search.label;" control="zotero-tb-search"/>
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse" onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { this.value = ''; this.doCommand('cmd_zotero_search'); return false; }">
<textbox id="zotero-tb-search" type="timed" timeout="250" oncommand="onSearch()" dir="reverse"
onkeypress="if(event.keyCode == event.DOM_VK_ESCAPE) { if (this.value == '') { cancelDialog(); return false; } this.value = ''; this.doCommand('cmd_zotero_search'); return false; } return true;">
<toolbarbutton id="zotero-tb-search-cancel" oncommand="this.parentNode.value='';" hidden="true"/>
</textbox>
</hbox>