diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-07-07 20:19:57 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-07-07 20:19:57 -0400 |
commit | 2f8beda6af9a3f360379ed689c2eb81833e23039 (patch) | |
tree | b7b52c1358864c6ecc89a22d01c1569c10561857 /assets/js/src/board.js | |
parent | 4807f3e8a0ac2cca2706fb8215b762541982c682 (diff) |
Move board collapse/expand mode to server side to avoid board flickering
Diffstat (limited to 'assets/js/src/board.js')
-rw-r--r-- | assets/js/src/board.js | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/assets/js/src/board.js b/assets/js/src/board.js index 01a16d59..d86610ef 100644 --- a/assets/js/src/board.js +++ b/assets/js/src/board.js @@ -20,7 +20,7 @@ }); Mousetrap.bind("s", function() { - stack_toggle(); + window.location = $(".board-display-mode").attr("href"); }); Mousetrap.bind("c", function() { @@ -28,74 +28,6 @@ }); } - // Collapse/Expand tasks - function stack_load_events() - { - $(".filter-expand-link").click(function(e) { - e.preventDefault(); - stack_expand(); - Kanboard.SetStorageItem(stack_key(), "expanded"); - }); - - $(".filter-collapse-link").click(function(e) { - e.preventDefault(); - stack_collapse(); - Kanboard.SetStorageItem(stack_key(), "collapsed"); - }); - - stack_show(); - } - - function stack_key() - { - var projectId = $('#board').data('project-id'); - return "board_stacking_" + projectId; - } - - function stack_collapse() - { - $(".filter-collapse").hide(); - $(".task-board-collapsed").show(); - - $(".filter-expand").show(); - $(".task-board-expanded").hide(); - } - - function stack_expand() - { - $(".filter-collapse").show(); - $(".task-board-collapsed").hide(); - - $(".filter-expand").hide(); - $(".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"; - - if (state === "expanded") { - stack_expand(); - } - else { - stack_collapse(); - } - } - // Setup the board function board_load_events() { @@ -243,7 +175,6 @@ $("#main").append(data); Kanboard.InitAfterAjax(); board_load_events(); - stack_show(); compactview_reload(); } }); @@ -263,7 +194,6 @@ Kanboard.InitAfterAjax(); board_unload_events(); board_load_events(); - stack_show(); compactview_reload(); } } @@ -312,7 +242,6 @@ if (Kanboard.Exists("board")) { board_load_events(); - stack_load_events(); compactview_load_events(); keyboard_shortcuts(); } |