diff options
author | xavier.vidal <xavier.vidal@pc-0608-008.oficinas.atrapalo.com> | 2015-09-29 09:46:02 +0200 |
---|---|---|
committer | xavier.vidal <xavier.vidal@pc-0608-008.oficinas.atrapalo.com> | 2015-09-29 09:46:02 +0200 |
commit | 118f265c11701d6e050650bd7eb8dd84508323ab (patch) | |
tree | 7ea6b3bf8d14f46835773a16b910e202ce2fbaaf /assets/js/src | |
parent | f6c1984bdd153d55731d18d57d95825c3298415c (diff) | |
parent | 91eeeee6c511246df56b4720f69d450b8787dd03 (diff) |
Merge branch 'master' into project_name_in_task_links
* master:
ajout captures pour les vues
essai intégration image
Append filters instead of replacing value for users and categories dropdowns
Do not show empty swimlanes in public view
Show complexity sum across all swimlanes
Show number of tasks for each column across all swimlanes
Fix regression (css)
Change swimlane layout to save space on the screen
Add the possibility to set/unset max column height (scrolling)
settings chapter
Add getPluginHomepage()
Add page to show the list of plugins
Do not use preventDefault() with .close-popover when there is no popover opened
Show "Open this task" in dropdown menu for closed tasks
Add contributor
Update app.css
Update popover.css
Show assignee on card only when someone is assigned
Diffstat (limited to 'assets/js/src')
-rw-r--r-- | assets/js/src/Board.js | 70 | ||||
-rw-r--r-- | assets/js/src/Popover.js | 11 | ||||
-rw-r--r-- | assets/js/src/Search.js | 6 | ||||
-rw-r--r-- | assets/js/src/Swimlane.js | 6 |
4 files changed, 65 insertions, 28 deletions
diff --git a/assets/js/src/Board.js b/assets/js/src/Board.js index 8d732c53..5370344c 100644 --- a/assets/js/src/Board.js +++ b/assets/js/src/Board.js @@ -8,13 +8,13 @@ Board.prototype.execute = function() { this.app.swimlane.listen(); this.restoreColumnViewMode(); this.compactView(); + this.columnScrolling(); this.poll(); this.keyboardShortcuts(); - this.resizeColumnHeight(); this.listen(); this.dragAndDrop(); - $(window).resize(this.resizeColumnHeight); + $(window).resize(this.columnScrolling); }; Board.prototype.poll = function() { @@ -85,7 +85,7 @@ Board.prototype.refresh = function(data) { this.app.refresh(); this.app.swimlane.refresh(); this.app.swimlane.listen(); - this.resizeColumnHeight(); + this.columnScrolling(); this.app.hideLoadingIcon(); this.listen(); this.dragAndDrop(); @@ -93,22 +93,6 @@ Board.prototype.refresh = function(data) { this.restoreColumnViewMode(); }; -Board.prototype.resizeColumnHeight = function() { - if ($(".board-swimlane").length > 1) { - $(".board-task-list").each(function() { - if ($(this).height() > 500) { - $(this).height(500); - } - else { - $(this).css("min-height", 320); // Min height is the height of the menu dropdown - } - }); - } - else { - $(".board-task-list").height($(window).height() - 145); - } -}; - Board.prototype.dragAndDrop = function() { var self = this; var params = { @@ -155,11 +139,58 @@ Board.prototype.listen = function() { self.toggleCompactView(); }); + $(document).on('click', ".filter-toggle-height", function(e) { + e.preventDefault(); + self.toggleColumnScrolling(); + }); + $(document).on("click", ".board-column-title", function() { self.toggleColumnViewMode($(this).data("column-id")); }); }; +Board.prototype.toggleColumnScrolling = function() { + var scrolling = localStorage.getItem("column_scroll") || 1; + localStorage.setItem("column_scroll", scrolling == 0 ? 1 : 0); + this.columnScrolling(); +}; + +Board.prototype.columnScrolling = function() { + if (localStorage.getItem("column_scroll") == 0) { + $(".filter-max-height").show(); + $(".filter-min-height").hide(); + + $(".board-task-list").each(function() { + $(this).css("min-height", 80); + $(this).css("height", ''); + $(".board-rotation-wrapper").css("min-height", ''); + }); + } + else { + + $(".filter-max-height").hide(); + $(".filter-min-height").show(); + + if ($(".board-swimlane").length > 1) { + $(".board-task-list").each(function() { + if ($(this).height() > 500) { + $(this).css("height", 500); + } + else { + $(this).css("min-height", 320); // Height of the dropdown menu + $(".board-rotation-wrapper").css("min-height", 320); + } + }); + } + else { + var height = $(window).height() - 145; + + $(".board-task-list").css("height", height); + $(".board-rotation-wrapper").css("min-height", height); + } + } +}; + Board.prototype.toggleCompactView = function() { var scrolling = localStorage.getItem("horizontal_scroll") || 1; localStorage.setItem("horizontal_scroll", scrolling == 0 ? 1 : 0); @@ -233,7 +264,6 @@ Board.prototype.hideColumn = function(columnId) { }); $(".board-column-" + columnId + " .board-rotation").each(function() { - var position = $(".board-swimlane").position(); $(this).css("width", $(".board-column-" + columnId + "").height()); }); diff --git a/assets/js/src/Popover.js b/assets/js/src/Popover.js index b978c087..e5bc1c88 100644 --- a/assets/js/src/Popover.js +++ b/assets/js/src/Popover.js @@ -21,11 +21,14 @@ Popover.prototype.open = function(link) { }; Popover.prototype.close = function(e) { - if (e) { - e.preventDefault(); - } + if (this.isOpen()) { + + if (e) { + e.preventDefault(); + } - $('#popover-container').remove(); + $('#popover-container').remove(); + } }; Popover.prototype.onClick = function(e) { diff --git a/assets/js/src/Search.js b/assets/js/src/Search.js index acacbaf9..1e7e294a 100644 --- a/assets/js/src/Search.js +++ b/assets/js/src/Search.js @@ -18,7 +18,13 @@ Search.prototype.listen = function() { // Filter helper for search $(document).on("click", ".filter-helper", function (e) { e.preventDefault(); + var filter = $(this).data("filter"); + var appendFilter = $(this).data("append-filter"); + + if (appendFilter) { + filter = $("#form-search").val() + " " + appendFilter; + } $("#form-search").val(filter); diff --git a/assets/js/src/Swimlane.js b/assets/js/src/Swimlane.js index 0edb4821..8dfc9d45 100644 --- a/assets/js/src/Swimlane.js +++ b/assets/js/src/Swimlane.js @@ -16,9 +16,8 @@ Swimlane.prototype.expand = function(swimlaneId) { localStorage.setItem(this.getStorageKey(), JSON.stringify(swimlaneIds)); $('.swimlane-row-' + swimlaneId).css('display', 'table-row'); - $('.show-icon-swimlane-' + swimlaneId).css('display', 'none'); $('.hide-icon-swimlane-' + swimlaneId).css('display', 'inline'); - $('.swimlane-task-count-' + swimlaneId).css('display', 'inline'); + $('.show-icon-swimlane-' + swimlaneId).css('display', 'none'); }; Swimlane.prototype.collapse = function(swimlaneId) { @@ -30,9 +29,8 @@ Swimlane.prototype.collapse = function(swimlaneId) { } $('.swimlane-row-' + swimlaneId).css('display', 'none'); - $('.show-icon-swimlane-' + swimlaneId).css('display', 'inline'); $('.hide-icon-swimlane-' + swimlaneId).css('display', 'none'); - $('.swimlane-task-count-' + swimlaneId).css('display', 'none'); + $('.show-icon-swimlane-' + swimlaneId).css('display', 'inline'); }; Swimlane.prototype.isCollapsed = function(swimlaneId) { |