Persist single position/size for all note windows
Previously, position/size was persisted for each item's note individually, but that meant that there was no default position/size for the note window and an entry was created in localstore.rdf for every note opened in a new window. There's also a good chance people had no idea what was going on.
This commit is contained in:
parent
370fa78048
commit
db6ec2b160
3 changed files with 9 additions and 15 deletions
|
@ -34,17 +34,12 @@ function onLoad() {
|
|||
// Set font size from pref
|
||||
Zotero.setFontSize(noteEditor);
|
||||
|
||||
var params = [];
|
||||
var b = document.location.href.substr(document.location.href.indexOf('?')+1).split('&');
|
||||
for(var i = 0; i < b.length; i++)
|
||||
{
|
||||
var mid = b[i].indexOf('=');
|
||||
|
||||
params[b[i].substr(0,mid)] = b[i].substr(mid+1);
|
||||
if (window.arguments) {
|
||||
var io = window.arguments[0];
|
||||
}
|
||||
var itemID = params.id;
|
||||
var collectionID = params.coll;
|
||||
var parentItemID = params.p;
|
||||
var itemID = io.itemID;
|
||||
var collectionID = io.collectionID;
|
||||
var parentItemID = io.parentItemID;
|
||||
|
||||
if (itemID) {
|
||||
var ref = Zotero.Items.get(itemID);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
height="350"
|
||||
title="&zotero.items.menu.attach.note;"
|
||||
persist="screenX screenY width height"
|
||||
windowtype="zotero:note"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script src="include.js"/>
|
||||
|
|
|
@ -3012,7 +3012,7 @@ var ZoteroPane = new function()
|
|||
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
var e = wm.getEnumerator('');
|
||||
var e = wm.getEnumerator('zotero:note');
|
||||
while (e.hasMoreElements()) {
|
||||
var w = e.getNext();
|
||||
if (w.name == name) {
|
||||
|
@ -3022,10 +3022,8 @@ var ZoteroPane = new function()
|
|||
}
|
||||
}
|
||||
|
||||
window.open('chrome://zotero/content/note.xul?v=1'
|
||||
+ (itemID ? '&id=' + itemID : '') + (col ? '&coll=' + col : '')
|
||||
+ (parentItemID ? '&p=' + parentItemID : ''),
|
||||
name, 'chrome,resizable,centerscreen');
|
||||
var io = { itemID: itemID, collectionID: col, parentItemID: parentItemID };
|
||||
window.openDialog('chrome://zotero/content/note.xul', name, 'chrome,resizable,centerscreen', io);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue