From 836495b54b4c33a08d5473a362f76db5e452182f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 21 Jan 2016 22:01:52 -0500 Subject: Set maximum dropzone height when the individual column scrolling is disabled --- assets/js/src/Board.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'assets/js/src/Board.js') 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 { -- cgit v1.2.3