summaryrefslogtreecommitdiff
path: root/assets/js/src/BoardTask.js
blob: 2b8ac1325155f466b7c8894edb36c6caabf0d633 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Kanboard.BoardTask = function(app) {
    this.app = app;
};

Kanboard.BoardTask.prototype.listen = function() {
    var self = this;

    $(document).on("click", ".task-board-change-assignee", function(e) {
        e.preventDefault();
        e.stopPropagation();
        self.app.get("Popover").open($(this).data('url'));
    });

    $(document).on("click", ".task-board", function(e) {
        if (e.target.tagName != "A" && e.target.tagName != "IMG") {
            window.location = $(this).data("task-url");
        }
    });
};

Kanboard.BoardTask.prototype.keyboardShortcuts = function() {
    var self = this;

    if (self.app.hasId("board")) {
        Mousetrap.bind("n", function () {
            self.app.get("Popover").open($("#board").data("task-creation-url"));
        });
    }
};