Author: jmorliaguet
Date: Sat Feb 18 17:01:21 2006
New Revision: 2417

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
Log:

- fixed leak between storages (too much data was stored in the local storage)



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sat Feb 18 
17:01:21 2006
@@ -986,6 +986,7 @@
 
   write: function(data) {
     var access = this.model.def.storage.access;
+    var stored;
 
     if (access && access.type) {
       var signature = data[access.signature];
@@ -994,15 +995,16 @@
         var next = this._queue[0];
         if (next in this._queued_data) {
           data = this._queued_data[next];
-          this._writeFields(data);
+          stored = this._writeFields(data);
           this._queue.shift();
         } else {
           break;
         }
       }
     } else {
-      this._writeFields(data);
+      stored = this._writeFields(data);
     }
+    return stored;
   },
 
   _writeFields: function(data) {
@@ -1019,6 +1021,7 @@
     // TODO compare old and new data
     this.model.def.data = filtered_data;
     CPSSkins.notify('stored', {'publisher': this});
+    return filtered_data;
   },
 
   merge: function(data) {
@@ -1087,8 +1090,8 @@
   },
 
   storeData: function(data) {
-    this.write(data);
-    value = escape(JSON.stringify(data));
+    var stored_data = this.write(data);
+    value = escape(JSON.stringify(stored_data));
     document.cookie = this.cookie_name + '=' + value + '; path=/';
   }
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to