Bind keyboard shortcut 'n' to the right view (refactoring)

This commit is contained in:
Frederic Guillot 2016-03-20 16:56:07 -04:00
parent 4c733eb715
commit 45f21e1cd8
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,9 @@ Kanboard.BoardTask.prototype.listen = function() {
Kanboard.BoardTask.prototype.keyboardShortcuts = function() {
var self = this;
Mousetrap.bind("n", function() {
self.app.get("Popover").open($("#board").data("task-creation-url"));
});
if (self.app.hasId("board")) {
Mousetrap.bind("n", function () {
self.app.get("Popover").open($("#board").data("task-creation-url"));
});
}
};

View File

@ -16,8 +16,6 @@ Kanboard.Search.prototype.focus = function() {
};
Kanboard.Search.prototype.listen = function() {
var self = this;
// Filter helper for search
$(document).on("click", ".filter-helper", function (e) {
e.preventDefault();