keyboard shortcut to star/unstar an entry

This commit is contained in:
Athou
2013-05-02 22:42:52 +02:00
parent b411528ac7
commit c2c07988b8

View File

@@ -518,8 +518,10 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
};
$scope.star = function(entry, star, event) {
event.preventDefault();
event.stopPropagation();
if (event) {
event.preventDefault();
event.stopPropagation();
}
if (entry.starred != star) {
entry.starred = star;
EntryService.star({
@@ -642,6 +644,13 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
window.open($scope.current.url);
}
});
Mousetrap.bind('s', function(e) {
$scope.$apply(function() {
if ($scope.current) {
$scope.star($scope.current, !$scope.current.starred);
}
});
});
Mousetrap.bind('?', function(e) {
$scope.$apply(function() {
$scope.shortcutsModal = true;