fix #1505 - The user only can drop if the backlog filters are closed
parent
0597881e02
commit
b900118aff
|
@ -57,6 +57,7 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
|||
|
||||
@scope.sectionName = "Backlog"
|
||||
@showTags = false
|
||||
@activeFilters = false
|
||||
|
||||
@.initializeEventHandlers()
|
||||
|
||||
|
@ -122,6 +123,9 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
|||
@showTags = !@showTags
|
||||
@rs.userstories.storeShowTags(@scope.projectId, @showTags)
|
||||
|
||||
toggleActiveFilters: ->
|
||||
@activeFilters = !@activeFilters
|
||||
|
||||
loadProjectStats: ->
|
||||
return @rs.projects.stats(@scope.projectId).then (stats) =>
|
||||
@scope.stats = stats
|
||||
|
@ -150,7 +154,6 @@ class BacklogController extends mixOf(taiga.Controller, taiga.PageMixin, taiga.F
|
|||
return sprints
|
||||
|
||||
resetFilters: ->
|
||||
@scope.$apply =>
|
||||
selectedTags = _.filter(@scope.filters.tags, "selected")
|
||||
selectedStatuses = _.filter(@scope.filters.statuses, "selected")
|
||||
|
||||
|
@ -623,12 +626,15 @@ BacklogDirective = ($repo, $rootscope) ->
|
|||
if !sidebar.hasClass("active")
|
||||
$ctrl.resetFilters()
|
||||
|
||||
$ctrl.toggleActiveFilters()
|
||||
|
||||
## Filters Link
|
||||
|
||||
linkFilters = ($scope, $el, $attrs, $ctrl) ->
|
||||
$scope.filtersSearch = {}
|
||||
$el.on "click", "#show-filters-button", (event) ->
|
||||
event.preventDefault()
|
||||
$scope.$apply ->
|
||||
showHideFilter($scope, $el, $ctrl)
|
||||
|
||||
link = ($scope, $el, $attrs, $rootscope) ->
|
||||
|
|
|
@ -39,7 +39,7 @@ deleteElement = (el) ->
|
|||
el.off()
|
||||
el.remove()
|
||||
|
||||
BacklogSortableDirective = ($repo, $rs, $rootscope) ->
|
||||
BacklogSortableDirective = ($repo, $rs, $rootscope, $tgConfirm) ->
|
||||
# Notes about jquery bug:
|
||||
# http://stackoverflow.com/questions/5791886/jquery-draggable-shows-
|
||||
# helper-in-wrong-place-when-scrolled-down-page
|
||||
|
@ -50,6 +50,9 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) ->
|
|||
if not (project.my_permissions.indexOf("modify_us") > -1)
|
||||
return
|
||||
|
||||
filterError = ->
|
||||
$tgConfirm.notify("error", "You can't drop on backlog when filters are open") #TODO: i18n
|
||||
|
||||
$el.sortable({
|
||||
connectWith: ".sprint-table"
|
||||
containment: ".wrapper"
|
||||
|
@ -67,9 +70,19 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) ->
|
|||
# position for revert).
|
||||
revert: false
|
||||
cursorAt: {right: 15}
|
||||
stop: () ->
|
||||
if $el.hasClass("active-filters")
|
||||
$el.sortable("cancel")
|
||||
filterError()
|
||||
})
|
||||
|
||||
$el.on "multiplesortreceive", (event, ui) ->
|
||||
if $el.hasClass("active-filters")
|
||||
ui.source.sortable("cancel")
|
||||
filterError()
|
||||
|
||||
return
|
||||
|
||||
itemUs = ui.item.scope().us
|
||||
itemIndex = ui.item.index()
|
||||
|
||||
|
@ -179,6 +192,7 @@ module.directive("tgBacklogSortable", [
|
|||
"$tgRepo",
|
||||
"$tgResources",
|
||||
"$rootScope",
|
||||
"$tgConfirm",
|
||||
BacklogSortableDirective
|
||||
])
|
||||
|
||||
|
|
|
@ -94,7 +94,8 @@
|
|||
|
||||
$(this.currentContainer.element).trigger('multiplesortreceive', {
|
||||
'item': current,
|
||||
'items': elms
|
||||
'items': elms,
|
||||
'source': this.element
|
||||
});
|
||||
} else if (current.hasClass(multipleSortableClass)) {
|
||||
// sort in the same list
|
||||
|
|
|
@ -6,5 +6,5 @@ div.backlog-table-header
|
|||
span.header-points Points
|
||||
span.icon.icon-arrow-bottom
|
||||
|
||||
div.backlog-table-body(tg-backlog-sortable, ng-class="{'show-tags': ctrl.showTags}" )
|
||||
div.backlog-table-body(tg-backlog-sortable, ng-class="{'show-tags': ctrl.showTags, 'active-filters': ctrl.activeFilters}" )
|
||||
include ../components/backlog-row
|
||||
|
|
Loading…
Reference in New Issue