← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21289: tracker/event-capture: orgunit directive is now moved to dhis-web-commons

 

------------------------------------------------------------
revno: 21289
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-12-03 12:30:42 +0100
message:
  tracker/event-capture: orgunit directive is now moved to dhis-web-commons
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/directives.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.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-event-capture/scripts/directives.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/directives.js	2015-12-01 14:01:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/directives.js	2015-12-03 11:30:42 +0000
@@ -6,33 +6,6 @@
 
 var eventCaptureDirectives = angular.module('eventCaptureDirectives', [])
 
-.directive('selectedOrgUnit', function ($timeout) {
-    return {
-        restrict: 'A',
-        link: function (scope, element, attrs) {
-            $("#orgUnitTree").one("ouwtLoaded", function (event, ids, names) {                                   
-                console.log('Finished loading orgunit tree');                        
-                $("#orgUnitTree").addClass("disable-clicks"); //Disable ou selection until meta-data has downloaded
-                $timeout(function () {
-                    scope.treeLoaded = true;
-                    scope.$apply();
-                });
-                downloadMetaData();                
-            });            
-
-            //listen to user selection, and inform angular         
-            selection.setListenerFunction(setSelectedOu, true);
-            function setSelectedOu(ids, names) {
-                var ou = {id: ids[0], name: names[0]};
-                $timeout(function () {
-                    scope.selectedOrgUnit = ou;
-                    scope.$apply();
-                });
-            }
-        }
-    };
-})
-
 .directive('d2FileInput', function(DHIS2EventService, DHIS2EventFactory, FileService, DialogService){
     
     return {

=== 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	2015-12-03 09:41:52 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js	2015-12-03 11:30:42 +0000
@@ -6,43 +6,6 @@
 
 var trackerCaptureDirectives = angular.module('trackerCaptureDirectives', [])
 
-.directive('selectedOrgUnit', function ($timeout) {
-    return {
-        restrict: 'A',
-        link: function (scope, element, attrs) {
-            
-            $("#orgUnitTree").one("ouwtLoaded", function (event, ids, names) {
-                if (dhis2.tc && dhis2.tc.metaDataCached) {
-                    $timeout(function () {
-                        scope.treeLoaded = true;
-                        scope.$apply();
-                    });
-                    selection.responseReceived();
-                }
-                else {
-                    console.log('Finished loading orgunit tree');
-                    $("#orgUnitTree").addClass("disable-clicks"); //Disable ou selection until meta-data has downloaded
-                    $timeout(function () {
-                        scope.treeLoaded = true;
-                        scope.$apply();
-                    });
-                    downloadMetaData();
-                }
-            });
-
-            //listen to user selection, and inform angular         
-            selection.setListenerFunction(setSelectedOu, true);
-            function setSelectedOu(ids, names) {
-                var ou = {id: ids[0], name: names[0]};
-                $timeout(function () {
-                    scope.selectedOrgUnit = ou;
-                    scope.$apply();
-                });
-            }
-        }
-    };
-})
-
 .directive('eventPaginator', function factory() {
 
     return {

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js	2015-11-27 09:35:48 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js	2015-12-03 11:30:42 +0000
@@ -7,6 +7,43 @@
 var d2Directives = angular.module('d2Directives', [])
 
 
+.directive('selectedOrgUnit', function ($timeout) {
+    return {
+        restrict: 'A',
+        link: function (scope, element, attrs) {
+            
+            $("#orgUnitTree").one("ouwtLoaded", function (event, ids, names) {
+                if (dhis2.tc && dhis2.tc.metaDataCached) {
+                    $timeout(function () {
+                        scope.treeLoaded = true;
+                        scope.$apply();
+                    });
+                    selection.responseReceived();
+                }
+                else {
+                    console.log('Finished loading orgunit tree');
+                    $("#orgUnitTree").addClass("disable-clicks"); //Disable ou selection until meta-data has downloaded
+                    $timeout(function () {
+                        scope.treeLoaded = true;
+                        scope.$apply();
+                    });
+                    downloadMetaData();
+                }
+            });
+
+            //listen to user selection, and inform angular         
+            selection.setListenerFunction(setSelectedOu, true);
+            function setSelectedOu(ids, names) {
+                var ou = {id: ids[0], name: names[0]};
+                $timeout(function () {
+                    scope.selectedOrgUnit = ou;
+                    scope.$apply();
+                });
+            }
+        }
+    };
+})
+
 .directive('d2SetFocus', function ($timeout) {
 
     return {