serialize data when tree is modified`

This commit is contained in:
Simon Kornblith 2011-02-22 18:43:05 +00:00
parent 826a0eb5e3
commit 57a38e19cb
2 changed files with 6 additions and 5 deletions

View file

@ -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;

View file

@ -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