=== 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 ); - } + } } } };