commit 57a38e19cb5bc443fd844e654ef215fd06cc97c5
parent 826a0eb5e344a36638deb84bdba41ff878e1026f
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 22 Feb 2011 18:43:05 +0000
serialize data when tree is modified`
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -310,7 +310,7 @@ var ZoteroPane = new function()
return;
}
- _serializePersist();
+ this.serializePersist();
var tagSelector = document.getElementById('zotero-tag-selector');
tagSelector.unregister();
@@ -345,7 +345,7 @@ var ZoteroPane = new function()
return false;
}
- _unserializePersist();
+ this.unserializePersist();
var containerWindow = (window.ZoteroTab ? window.ZoteroTab.containerWindow : window);
if(containerWindow.zoteroSavedSelection) {
@@ -393,7 +393,7 @@ var ZoteroPane = new function()
* Function to be called before ZoteroPane is hidden. Does not actually hide the Zotero pane.
*/
this.makeHidden = function() {
- _serializePersist();
+ this.serializePersist();
}
function isShowing() {
@@ -3515,7 +3515,7 @@ var ZoteroPane = new function()
/**
* Unserializes zotero-persist elements from preferences
*/
- function _unserializePersist() {
+ this.unserializePersist = function() {
var serializedValues = Zotero.Prefs.get("pane.persist");
if(!serializedValues) return;
serializedValues = JSON.parse(serializedValues);
@@ -3539,7 +3539,7 @@ var ZoteroPane = new function()
/**
* Serializes zotero-persist elements to preferences
*/
- function _serializePersist() {
+ this.serializePersist = function() {
var serializedValues = {};
for each(var el in document.getElementsByAttribute("zotero-persist", "*")) {
if(!el.getAttribute) continue;
diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul
@@ -305,6 +305,7 @@
ondragenter="return ZoteroPane.itemsView.onDragEnter(event)"
ondragover="return ZoteroPane.itemsView.onDragOver(event)"
ondragdrop="return ZoteroPane.itemsView.onDrop(event)"
+ oncommand="ZoteroPane.serializePersist()"
flex="1">
<treecols>
<treecol