forked from Archives/Athou_commafeed
keyboard shortcut to star/unstar an entry
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user