summaryrefslogtreecommitdiff
path: root/assets/js/src/BoardCollapsedMode.js
blob: 8365d3fbe6817885b61e94d56a103b283e1c6578 (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
Kanboard.BoardCollapsedMode = function(app) {
    this.app = app;
};

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

    if (self.app.hasId("board")) {
        Mousetrap.bind("s", function() {
            self.toggle();
        });
    }
};

Kanboard.BoardCollapsedMode.prototype.toggle = function() {
    var self = this;
    this.app.showLoadingIcon();

    $.ajax({
        cache: false,
        url: $('.filter-display-mode:not([style="display: none;"]) a').attr('href'),
        success: function(data) {
            $('.filter-display-mode').toggle();
            self.app.get("BoardDragAndDrop").refresh(data);
        }
    });
};