← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17115: tracker capture - making sure directive is triggered after metadata is downloaded

 

------------------------------------------------------------
revno: 17115
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-10-15 00:43:48 +0200
message:
  tracker capture - making sure directive is triggered after metadata is downloaded
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.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-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js	2014-10-14 10:47:16 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js	2014-10-14 22:43:48 +0000
@@ -21,52 +21,9 @@
     return {        
         restrict: 'A',        
         link: function(scope, element, attrs){  
-            
-            //when tree has loaded, get selected orgunit - if there is any - and inform angular           
-            /*$(function() {                 
-                
-                var adapters = [];
-                var partial_adapters = [];
-
-                if( dhis2.ou.memoryOnly ) {
-                    adapters = [ dhis2.storage.InMemoryAdapter ];
-                    partial_adapters = [ dhis2.storage.InMemoryAdapter ];
-                } else {
-                    adapters = [ dhis2.storage.IndexedDBAdapter, dhis2.storage.DomLocalStorageAdapter, dhis2.storage.InMemoryAdapter ];
-                    partial_adapters = [ dhis2.storage.IndexedDBAdapter, dhis2.storage.DomSessionStorageAdapter, dhis2.storage.InMemoryAdapter ];
-                }
-
-                dhis2.ou.store = new dhis2.storage.Store({
-                    name: OU_STORE_NAME,
-                    objectStores: [
-                        {
-                            name: OU_KEY,
-                            adapters: adapters
-                        },
-                        {
-                            name: OU_PARTIAL_KEY,
-                            adapters: partial_adapters
-                        }
-                    ]
-                });
-
-                dhis2.ou.store.open().done( function() {
-                    selection.load();
-                    $( "#orgUnitTree" ).one( "ouwtLoaded", function() {
-                        var selected = selection.getSelected()[0];
-                        selection.getOrganisationUnit(selected).done(function(data){                            
-                            if( data ){
-                                scope.selectedOrgUnit = {id: selected, name: data[selected].n};
-                                scope.$apply();                                                              
-                            }                        
-                        });
-                    });
-                    
-                });
-            });*/
-            
+           
             //listen to user selection, and inform angular         
-            selection.setListenerFunction( organisationUnitSelected );
+            selection.setListenerFunction( organisationUnitSelected, true );
             selection.responseReceived();
             
             function organisationUnitSelected( orgUnits, orgUnitNames ) {