diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-26 13:55:37 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-26 13:55:37 +0100 |
commit | 485bb64ddbcc372c5ed3d74190eda06f02cb3f82 (patch) | |
tree | e89ec33366b907bea794e9140f962d2951b29ff9 /webclient/room/room-directive.js | |
parent | Use new StreamToken in pagination config (diff) | |
parent | Add the ability to turn on the twisted manhole telnet service. (diff) | |
download | synapse-485bb64ddbcc372c5ed3d74190eda06f02cb3f82.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into stream_refactor
Diffstat (limited to 'webclient/room/room-directive.js')
-rw-r--r-- | webclient/room/room-directive.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/webclient/room/room-directive.js b/webclient/room/room-directive.js index 94655336df..1a99a37abb 100644 --- a/webclient/room/room-directive.js +++ b/webclient/room/room-directive.js @@ -17,30 +17,30 @@ 'use strict'; angular.module('RoomController') -.directive('autoComplete', ['$timeout', function ($timeout) { +.directive('tabComplete', ['$timeout', function ($timeout) { return function (scope, element, attrs) { element.bind("keydown keypress", function (event) { // console.log("event: " + event.which); if (event.which === 9) { - if (!scope.autoCompleting) { // cache our starting text + if (!scope.tabCompleting) { // cache our starting text // console.log("caching " + element[0].value); - scope.autoCompleteOriginal = element[0].value; - scope.autoCompleting = true; + scope.tabCompleteOriginal = element[0].value; + scope.tabCompleting = true; } if (event.shiftKey) { - scope.autoCompleteIndex--; - if (scope.autoCompleteIndex < 0) { - scope.autoCompleteIndex = 0; + scope.tabCompleteIndex--; + if (scope.tabCompleteIndex < 0) { + scope.tabCompleteIndex = 0; } } else { - scope.autoCompleteIndex++; + scope.tabCompleteIndex++; } var searchIndex = 0; - var targetIndex = scope.autoCompleteIndex; - var text = scope.autoCompleteOriginal; + var targetIndex = scope.tabCompleteIndex; + var text = scope.tabCompleteOriginal; // console.log("targetIndex: " + targetIndex + ", text=" + text); @@ -90,17 +90,17 @@ angular.module('RoomController') element[0].className = ""; }, 150); element[0].value = text; - scope.autoCompleteIndex = 0; + scope.tabCompleteIndex = 0; } } else { - scope.autoCompleteIndex = 0; + scope.tabCompleteIndex = 0; } event.preventDefault(); } - else if (event.which !== 16 && scope.autoCompleting) { - scope.autoCompleting = false; - scope.autoCompleteIndex = 0; + else if (event.which !== 16 && scope.tabCompleting) { + scope.tabCompleting = false; + scope.tabCompleteIndex = 0; } }); }; |