You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/09/22 04:35:04 UTC

ignite git commit: IGNITE-843 Minor fix.

Repository: ignite
Updated Branches:
  refs/heads/ignite-843 8c04d1d9e -> 2846cf7fa


IGNITE-843 Minor fix.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2846cf7f
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2846cf7f
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2846cf7f

Branch: refs/heads/ignite-843
Commit: 2846cf7fabbeaa093c3fe058c4868ebd50514189
Parents: 8c04d1d
Author: vsisko <vs...@gridgain.com>
Authored: Tue Sep 22 09:35:04 2015 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Tue Sep 22 09:35:04 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/common-module.js             | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2846cf7f/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 8125ff0..e16b55f 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -1556,6 +1556,8 @@ controlCenterModule.directive('onEscape', function () {
 
 // Directive to retain selection. To fix angular-strap typeahead bug with setting cursor to the end of text.
 controlCenterModule.directive('retainSelection', function ($timeout) {
+    var promise;
+
     return function (scope, elem, attr) {
         elem.on('keydown', function (evt) {
             var key = evt.which;
@@ -1563,7 +1565,10 @@ controlCenterModule.directive('retainSelection', function ($timeout) {
             var input = this;
             var start = input.selectionStart;
 
-            $timeout(function () {
+            if (promise)
+                $timeout.cancel(promise);
+
+            promise = $timeout(function () {
                 var setCursor = false;
 
                 // Handle Backspace[8].
@@ -1576,7 +1581,7 @@ controlCenterModule.directive('retainSelection', function ($timeout) {
                 else if (key == 46)
                     setCursor = true;
                 // Handle: Caps Lock[20], Tab[9], Shift[16], Ctrl[17], Alt[18], Esc[27], Enter[13], Arrows[37..40], Home[36], End[35], Ins[45], PgUp[33], PgDown[34], F1..F12[111..124], Num Lock[], Scroll Lock[145].
-                else if (!(key == 9 || key == 13 || (key > 15 && key < 20) || key == 27 ||
+                else if (!(key == 8 || key == 9 || key == 13 || (key > 15 && key < 20) || key == 27 ||
                     (key > 32 && key < 41) || key == 45 || (key > 111 && key < 124) || key == 144 || key == 145)) {
                     // Handle: Ctrl + [A[65], C[67], V[86]].
                     if (!(ctrlDown && (key = 65 || key == 67 || key == 86))) {
@@ -1588,6 +1593,8 @@ controlCenterModule.directive('retainSelection', function ($timeout) {
 
                 if (setCursor)
                     input.setSelectionRange(start, start);
+
+                promise = undefined;
             });
         });