diff options
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | app/assets/javascripts/milestone.js.coffee | 30 |
2 files changed, 24 insertions, 9 deletions
diff --git a/CHANGELOG b/CHANGELOG index 897114c1442..49e4b694399 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,9 @@ v 8.5.1 - Add when the Builds & Runners API changes got introduced - Fix Side-by-side view after loading diff results - Fix error 500 on some merged merge requests + - Issues can now be dragged & dropped into empty milestone lists. This is also + possible with MRs + - Fix an issue where MRs weren't sortable v 8.5.0 - Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu) diff --git a/app/assets/javascripts/milestone.js.coffee b/app/assets/javascripts/milestone.js.coffee index 31f6c6d3d47..e6d8518bec8 100644 --- a/app/assets/javascripts/milestone.js.coffee +++ b/app/assets/javascripts/milestone.js.coffee @@ -62,6 +62,11 @@ class @Milestone dataType: "json" constructor: -> + oldMouseStart = $.ui.sortable.prototype._mouseStart + $.ui.sortable.prototype._mouseStart = (event, overrideHandle, noActivation) -> + this._trigger "beforeStart", event, this._uiHash() + oldMouseStart.apply this, [event, overrideHandle, noActivation] + @bindIssuesSorting() @bindMergeRequestSorting() @bindTabsSwitching @@ -71,6 +76,10 @@ class @Milestone connectWith: ".issues-sortable-list", dropOnEmpty: true, items: "li:not(.ui-sort-disabled)", + beforeStart: (event, ui) -> + $(".issues-sortable-list").css "min-height", ui.item.outerHeight() + stop: (event, ui) -> + $(".issues-sortable-list").css "min-height", "0px" update: (event, ui) -> data = $(this).sortable("serialize") Milestone.sortIssues(data) @@ -96,10 +105,22 @@ class @Milestone ).disableSelection() bindMergeRequestSorting: -> + $('a[data-toggle="tab"]').on 'show.bs.tab', (e) -> + currentTabClass = $(e.target).data('show') + previousTabClass = $(e.relatedTarget).data('show') + + $(previousTabClass).hide() + $(currentTabClass).removeClass('hidden') + $(currentTabClass).show() + $("#merge_requests-list-unassigned, #merge_requests-list-ongoing, #merge_requests-list-closed").sortable( connectWith: ".merge_requests-sortable-list", dropOnEmpty: true, items: "li:not(.ui-sort-disabled)", + beforeStart: (event, ui) -> + $(".merge_requests-sortable-list").css "min-height", ui.item.outerHeight() + stop: (event, ui) -> + $(".merge_requests-sortable-list").css "min-height", "0px" update: (event, ui) -> data = $(this).sortable("serialize") Milestone.sortMergeRequests(data) @@ -123,12 +144,3 @@ class @Milestone Milestone.updateMergeRequest(ui.item, merge_request_url, data) ).disableSelection() - - bindMergeRequestSorting: -> - $('a[data-toggle="tab"]').on 'show.bs.tab', (e) -> - currentTabClass = $(e.target).data('show') - previousTabClass = $(e.relatedTarget).data('show') - - $(previousTabClass).hide() - $(currentTabClass).removeClass('hidden') - $(currentTabClass).show() |