Fixed login cancel call bug, Ctrl+Tab hotkey

This commit is contained in:
Igor Zhukov 2014-06-05 15:40:52 +04:00
parent 50a951e577
commit bdab3da0e5
3 changed files with 12 additions and 4 deletions

View File

@ -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) {

View File

@ -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);
}

View File

@ -26,7 +26,7 @@
</form>
<form name="myLoginForm" ng-if="credentials.phone_code_hash" ng-submit="logIn()">
<h3 class="login_form_head"><span ng-bind="credentials.phone_country"></span> <span ng-bind="credentials.phone_number"></span> <small>(<a ng-click="credentials.phone_code_hash = ''">edit</a>)</small></h3>
<h3 class="login_form_head"><span ng-bind="credentials.phone_country"></span> <span ng-bind="credentials.phone_number"></span> <small>(<a ng-click="editPhone()">edit</a>)</small></h3>
<p class="login_form_lead">We have sent you a code via SMS.<br/>Please enter it below.</p>
<p class="login_form_lead">