summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-05 18:46:34 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-05 18:46:34 +0200
commitb3be06667d7b0968b808c77487a2909578a729cd (patch)
tree3e6cdee55aa23dd7ade7e469026dc13d303d5672 /webclient
parentBF: Update the members list on banned & kicked "events" (diff)
downloadsynapse-b3be06667d7b0968b808c77487a2909578a729cd.tar.xz
BF: tab completion did not work with commands. $scope.input contained only the typed chars not the result of the completion.
Needed to fire an event so that ng update the input model
Diffstat (limited to '')
-rw-r--r--webclient/room/room-directive.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/webclient/room/room-directive.js b/webclient/room/room-directive.js
index 659bcbc60f..e033b003e1 100644
--- a/webclient/room/room-directive.js
+++ b/webclient/room/room-directive.js
@@ -48,6 +48,9 @@ angular.module('RoomController')
                 var search = /@?([a-zA-Z0-9_\-:\.]+)$/.exec(text);
                 if (targetIndex === 0) {
                     element[0].value = text;
+                    
+                    // Force angular to wake up and update the input ng-model by firing up input event
+                    angular.element(element[0]).triggerHandler('input');
                 }
                 else if (search && search[1]) {
                     // console.log("search found: " + search);
@@ -81,7 +84,10 @@ angular.module('RoomController')
                             expansion += " ";
                         element[0].value = text.replace(/@?([a-zA-Z0-9_\-:\.]+)$/, expansion);
                         // cancel blink
-                        element[0].className = "";                        
+                        element[0].className = "";     
+                        
+                        // Force angular to wake up and update the input ng-model by firing up input event
+                        angular.element(element[0]).triggerHandler('input');
                     }
                     else {
                         // console.log("wrapped!");
@@ -91,6 +97,9 @@ angular.module('RoomController')
                         }, 150);
                         element[0].value = text;
                         scope.tabCompleteIndex = 0;
+                        
+                        // Force angular to wake up and update the input ng-model by firing up input event
+                        angular.element(element[0]).triggerHandler('input');
                     }
                 }
                 else {