← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10439: minor fix

 

------------------------------------------------------------
revno: 10439
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-03-30 18:49:56 +0700
message:
  minor fix
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.storage.dom-ss.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.storage.dom-ss.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.storage.dom-ss.js	2013-02-22 03:59:31 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.storage.dom-ss.js	2013-03-30 11:49:56 +0000
@@ -1,5 +1,5 @@
 // dom storage support (sessionStorage)
-dhis2.storage.Store.adapter( 'dom-ss', (function () {
+dhis2.storage.Store.adapter( 'dom', (function () {
     var storage = window.sessionStorage;
 
     var indexer = function ( dbname, name ) {
@@ -68,17 +68,18 @@
         addAll: function ( keys, objs, callback ) {
             var that = this;
 
-            if ( keys.length == 0 || objs.length == 0 ) {
-                if ( callback ) callback.call( that, that );
-                return;
+            while ( keys.length != 0 ) {
+                var key = keys.pop();
+                var obj = objs.pop();
+
+                try {
+                    that.add( key, obj );
+                } catch ( e ) {
+                    break;
+                }
             }
 
-            var key = keys.pop();
-            var obj = objs.pop();
-
-            this.add( key, obj, function ( store ) {
-                that.addAll( keys, objs, callback );
-            } );
+            if ( callback ) callback.call( that, that );
         },
 
         remove: function ( key, callback ) {