Added esc handling

This commit is contained in:
Igor Zhukov 2015-01-02 16:55:26 +01:00
parent b024186a5c
commit 191d7514d8
2 changed files with 8 additions and 0 deletions

View File

@ -336,6 +336,10 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
});
$scope.$on('esc_no_more', function () {
$location.url('/im');
});
$scope.isLoggedIn = true;
$scope.isEmpty = {};
@ -1145,6 +1149,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
}
function showEmptyHistory () {
safeReplaceObject($scope.historyPeer, {});
safeReplaceObject($scope.state, {notSelected: true});
peerHistory = false;
hasMore = false;

View File

@ -459,6 +459,9 @@ angular.module('myApp.directives', ['myApp.filters'])
else if (searchField.value) {
$(searchClear).trigger('click');
}
else {
$scope.$emit('esc_no_more');
}
return cancelEvent(e);
}