From bdab3da0e527e8ef9c06763467c7e6df95753ffe Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Thu, 5 Jun 2014 15:40:52 +0400 Subject: [PATCH] Fixed login cancel call bug, Ctrl+Tab hotkey --- app/js/controllers.js | 10 +++++++++- app/js/directives.js | 4 ++-- app/partials/login.html | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 2b95ac21..63d9d0a8 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -139,7 +139,7 @@ angular.module('myApp.controllers', []) $scope.credentials.phone_occupied = sentCode.phone_registered; $scope.error = {}; - $scope.callPending.remaining = sentCode.send_call_timeout; + $scope.callPending.remaining = sentCode.send_call_timeout || 60; callCheck(); }, function (error) { @@ -171,8 +171,16 @@ angular.module('myApp.controllers', []) } }); }); + } + $scope.editPhone = function () { + $timeout.cancel(callTimeout); + + delete $scope.credentials.phone_code_hash; + delete $scope.credentials.phone_occupied; + delete $scope.callPending.remaining; + delete $scope.callPending.success; } $scope.logIn = function (forceSignUp) { diff --git a/app/js/directives.js b/app/js/directives.js index 37da2fd2..a710b7da 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -66,7 +66,7 @@ angular.module('myApp.directives', ['myApp.filters']) return cancelEvent(e); } - if (e.keyCode == 27 || e.keyCode == 9 && e.shiftKey) { // ESC or Shift + Tab + if (e.keyCode == 27 || e.keyCode == 9 && e.shiftKey && !e.ctrlKey && !e.metaKey) { // ESC or Shift + Tab if (!searchFocused) { searchField.focus(); if (searchField.value) { @@ -672,7 +672,7 @@ angular.module('myApp.directives', ['myApp.filters']) }; function onKeyDown(e) { - if (e.keyCode == 9 && !e.shiftKey && !$modalStack.getTop()) { // TAB + if (e.keyCode == 9 && !e.shiftKey && !e.ctrlKey && !e.metaKey && !$modalStack.getTop()) { // TAB editorElement.focus(); return cancelEvent(e); } diff --git a/app/partials/login.html b/app/partials/login.html index 3b3baa39..13945ac2 100644 --- a/app/partials/login.html +++ b/app/partials/login.html @@ -26,7 +26,7 @@
- +