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
|
@ -34,17 +34,12 @@ function onLoad() {
|
||||||
// Set font size from pref
|
// Set font size from pref
|
||||||
Zotero.setFontSize(noteEditor);
|
Zotero.setFontSize(noteEditor);
|
||||||
|
|
||||||
var params = [];
|
if (window.arguments) {
|
||||||
var b = document.location.href.substr(document.location.href.indexOf('?')+1).split('&');
|
var io = window.arguments[0];
|
||||||
for(var i = 0; i < b.length; i++)
|
|
||||||
{
|
|
||||||
var mid = b[i].indexOf('=');
|
|
||||||
|
|
||||||
params[b[i].substr(0,mid)] = b[i].substr(mid+1);
|
|
||||||
}
|
}
|
||||||
var itemID = params.id;
|
var itemID = io.itemID;
|
||||||
var collectionID = params.coll;
|
var collectionID = io.collectionID;
|
||||||
var parentItemID = params.p;
|
var parentItemID = io.parentItemID;
|
||||||
|
|
||||||
if (itemID) {
|
if (itemID) {
|
||||||
var ref = Zotero.Items.get(itemID);
|
var ref = Zotero.Items.get(itemID);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
height="350"
|
height="350"
|
||||||
title="&zotero.items.menu.attach.note;"
|
title="&zotero.items.menu.attach.note;"
|
||||||
persist="screenX screenY width height"
|
persist="screenX screenY width height"
|
||||||
|
windowtype="zotero:note"
|
||||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||||
|
|
||||||
<script src="include.js"/>
|
<script src="include.js"/>
|
||||||
|
|
|
@ -3012,7 +3012,7 @@ var ZoteroPane = new function()
|
||||||
|
|
||||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||||
.getService(Components.interfaces.nsIWindowMediator);
|
.getService(Components.interfaces.nsIWindowMediator);
|
||||||
var e = wm.getEnumerator('');
|
var e = wm.getEnumerator('zotero:note');
|
||||||
while (e.hasMoreElements()) {
|
while (e.hasMoreElements()) {
|
||||||
var w = e.getNext();
|
var w = e.getNext();
|
||||||
if (w.name == name) {
|
if (w.name == name) {
|
||||||
|
@ -3022,10 +3022,8 @@ var ZoteroPane = new function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.open('chrome://zotero/content/note.xul?v=1'
|
var io = { itemID: itemID, collectionID: col, parentItemID: parentItemID };
|
||||||
+ (itemID ? '&id=' + itemID : '') + (col ? '&coll=' + col : '')
|
window.openDialog('chrome://zotero/content/note.xul', name, 'chrome,resizable,centerscreen', io);
|
||||||
+ (parentItemID ? '&p=' + parentItemID : ''),
|
|
||||||
name, 'chrome,resizable,centerscreen');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user