Browse Source

Fixed login cancel call bug, Ctrl+Tab hotkey

master
Igor Zhukov 11 years ago
parent
commit
bdab3da0e5
  1. 10
      app/js/controllers.js
  2. 4
      app/js/directives.js
  3. 2
      app/partials/login.html

10
app/js/controllers.js

@ -139,7 +139,7 @@ angular.module('myApp.controllers', [])
$scope.credentials.phone_occupied = sentCode.phone_registered; $scope.credentials.phone_occupied = sentCode.phone_registered;
$scope.error = {}; $scope.error = {};
$scope.callPending.remaining = sentCode.send_call_timeout; $scope.callPending.remaining = sentCode.send_call_timeout || 60;
callCheck(); callCheck();
}, function (error) { }, 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) { $scope.logIn = function (forceSignUp) {

4
app/js/directives.js

@ -66,7 +66,7 @@ angular.module('myApp.directives', ['myApp.filters'])
return cancelEvent(e); 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) { if (!searchFocused) {
searchField.focus(); searchField.focus();
if (searchField.value) { if (searchField.value) {
@ -672,7 +672,7 @@ angular.module('myApp.directives', ['myApp.filters'])
}; };
function onKeyDown(e) { 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(); editorElement.focus();
return cancelEvent(e); return cancelEvent(e);
} }

2
app/partials/login.html

@ -26,7 +26,7 @@
</form> </form>
<form name="myLoginForm" ng-if="credentials.phone_code_hash" ng-submit="logIn()"> <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">We have sent you a code via SMS.<br/>Please enter it below.</p>
<p class="login_form_lead"> <p class="login_form_lead">

Loading…
Cancel
Save