diff options
Diffstat (limited to 'assets/js/src/board.js')
-rw-r--r-- | assets/js/src/board.js | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/assets/js/src/board.js b/assets/js/src/board.js index 45b43794..ecf94b9c 100644 --- a/assets/js/src/board.js +++ b/assets/js/src/board.js @@ -16,6 +16,10 @@ Kanboard.Board = (function() { Kanboard.InitAfterAjax ); }); + + Mousetrap.bind("s", function() { + stack_toggle(); + }); } // Collapse/Expand tasks @@ -24,13 +28,13 @@ Kanboard.Board = (function() { $(".filter-expand-link").click(function(e) { e.preventDefault(); stack_expand(); - Kanboard.SetStorageItem(stack_key(), "expanded") + Kanboard.SetStorageItem(stack_key(), "expanded"); }); $(".filter-collapse-link").click(function(e) { e.preventDefault(); stack_collapse(); - Kanboard.SetStorageItem(stack_key(), "collapsed") + Kanboard.SetStorageItem(stack_key(), "collapsed"); }); stack_show(); @@ -60,6 +64,20 @@ Kanboard.Board = (function() { $(".task-board-expanded").show(); } + function stack_toggle() + { + var state = Kanboard.GetStorageItem(stack_key()) || "expanded"; + + if (state === "expanded") { + stack_collapse(); + Kanboard.SetStorageItem(stack_key(), "collapsed"); + } + else { + stack_expand(); + Kanboard.SetStorageItem(stack_key(), "expanded"); + } + } + function stack_show() { var state = Kanboard.GetStorageItem(stack_key()) || "expanded"; |