← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16387: event capture - more interactive option list when editing events in grid

 

------------------------------------------------------------
revno: 16387
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-08-12 12:04:27 +0200
message:
  event capture - more interactive option list when editing events in grid
modified:
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-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-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js	2014-07-06 12:46:18 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/directives.js	2014-08-12 10:04:27 +0000
@@ -207,13 +207,19 @@
 
 .directive('typeaheadOpenOnFocus', function () {
   return {
-    require: ['typeahead', 'ngModel'],
-    link: function (scope, element, attr, ctrls) {        
-      element.bind('focus', function () {
-        ctrls[0].getMatchesAsync(ctrls[1].$viewValue);
-      });
-    }
-  };
+        require: ['typeahead', 'ngModel'],
+        link: function (scope, element, attr, ctrls) {        
+            element.bind('focus', function () {
+                ctrls[0].getMatchesAsync(ctrls[1].$viewValue);
+                
+                scope.$watch(attr.ngModel, function(value) {
+                    if(value === '' || angular.isUndefined(value)){
+                        ctrls[0].getMatchesAsync(ctrls[1].$viewValue);
+                    }                
+                });
+            });
+        }
+    };
 })
 
 .directive('draggableModal', function(){