← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18453: Ouwt, delay, workaround for slow indexed db

 

------------------------------------------------------------
revno: 18453
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-03-02 10:46:10 +0100
message:
  Ouwt, delay, workaround for slow indexed db
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.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/ouwt/ouwt.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2015-01-08 10:24:18 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ouwt/ouwt.js	2015-03-02 09:46:10 +0000
@@ -471,10 +471,15 @@
                     selection.busy( false );
                 });
             }
-            
+
           selection.busy( true );
 
-          doSync();
+          if( selection.getSelected() && selection.getSelected().length === 0 ) {
+        	  setTimeout(doSync, 1000); // Workaround for indexeddb slowness
+          } 
+          else {
+        	  doSync();
+          }
         }
     };
 
@@ -598,7 +603,7 @@
                 ids.push( item );
                 names.push( name );
             } );
-
+            
             $( document ).trigger( dhis2.ou.event.orgUnitSelected, [ids, names, children] );
             
             if( typeof listenerFunction === 'function') {
@@ -618,10 +623,10 @@
                 names.push( name );
 
                 $( document ).trigger( dhis2.ou.event.orgUnitSelected, [ids, names, children] );
-                
+
                 if( typeof listenerFunction === 'function') {
                 	listenerFunction( ids, names, children );
-                }                
+                }
             }
         }
     };