diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-21 22:01:52 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-21 22:01:52 -0500 |
commit | 836495b54b4c33a08d5473a362f76db5e452182f (patch) | |
tree | e39c8b0fb4698ecf616e79340715a1dd41e84e07 /assets/js/src/Board.js | |
parent | 325e72589d1619f7f3bcc5c7425d800d31e22bd6 (diff) |
Set maximum dropzone height when the individual column scrolling is disabled
Diffstat (limited to 'assets/js/src/Board.js')
-rw-r--r-- | assets/js/src/Board.js | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/assets/js/src/Board.js b/assets/js/src/Board.js index b7c1937a..3aabf472 100644 --- a/assets/js/src/Board.js +++ b/assets/js/src/Board.js @@ -8,12 +8,12 @@ Board.prototype.execute = function() { this.app.swimlane.refresh(); this.restoreColumnViewMode(); this.compactView(); - this.columnScrolling(); this.poll(); this.keyboardShortcuts(); this.listen(); this.dragAndDrop(); + $(window).on("load", this.columnScrolling); $(window).resize(this.columnScrolling); }; @@ -91,12 +91,12 @@ Board.prototype.refresh = function(data) { this.app.refresh(); this.app.swimlane.refresh(); - this.columnScrolling(); this.app.hideLoadingIcon(); this.listen(); this.dragAndDrop(); this.compactView(); this.restoreColumnViewMode(); + this.columnScrolling(); }; Board.prototype.dragAndDrop = function() { @@ -164,21 +164,34 @@ Board.prototype.listen = function() { }; Board.prototype.toggleColumnScrolling = function() { - var scrolling = localStorage.getItem("column_scroll") || 1; + var scrolling = localStorage.getItem("column_scroll"); + + if (scrolling == undefined) { + scrolling = 1; + } + localStorage.setItem("column_scroll", scrolling == 0 ? 1 : 0); this.columnScrolling(); }; Board.prototype.columnScrolling = function() { if (localStorage.getItem("column_scroll") == 0) { + var height = 80; + $(".filter-max-height").show(); $(".filter-min-height").hide(); + $(".board-rotation-wrapper").css("min-height", ''); $(".board-task-list").each(function() { - $(this).css("min-height", 80); - $(this).css("height", ''); - $(".board-rotation-wrapper").css("min-height", ''); + var columnHeight = $(this).height(); + + if (columnHeight > height) { + height = columnHeight; + } }); + + $(".board-task-list").css("min-height", height); + $(".board-task-list").css("height", ''); } else { |