Added new keyboard shortcut for task view

This commit is contained in:
Frederic Guillot
2016-03-11 22:46:54 -05:00
parent b95375c324
commit 4f54a547fa
8 changed files with 55 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ function App() {
this.column = new Column(this);
this.file = new FileUpload(this);
this.keyboardShortcuts();
this.task.keyboardShortcuts();
this.chosen();
this.poll();

View File

@@ -2,6 +2,29 @@ function Task(app) {
this.app = app;
}
Task.prototype.keyboardShortcuts = function() {
var taskView = $("#task-view");
var self = this;
if (taskView.length) {
Mousetrap.bind("e", function() {
self.app.popover.open(taskView.data("edit-url"));
});
Mousetrap.bind("c", function() {
self.app.popover.open(taskView.data("comment-url"));
});
Mousetrap.bind("s", function() {
self.app.popover.open(taskView.data("subtask-url"));
});
Mousetrap.bind("l", function() {
self.app.popover.open(taskView.data("internal-link-url"));
});
}
};
Task.prototype.listen = function() {
var self = this;
var reloadingProjectId = 0;