Fix issue 2817 - us backlog drag position at start

- Before when the user clicked on the left of a backlog US, the US position try to reach the drag icon.
- Now when the US starts dragging preserve their position and if you move it to the sprint the US overflowing the X without scroll.
stable
Juanfran 2015-06-09 12:30:55 +02:00 committed by David Barragán Merino
parent de66acf48c
commit 861ac9b540
3 changed files with 22 additions and 10 deletions

View File

@ -61,10 +61,10 @@ BacklogSortableDirective = ($repo, $rs, $rootscope, $tgConfirm, $translate) ->
items: ".us-item-row", items: ".us-item-row",
cancel: ".popover" cancel: ".popover"
connectWith: ".sprint" connectWith: ".sprint"
containment: ".wrapper"
dropOnEmpty: true dropOnEmpty: true
placeholder: "row us-item-row us-item-drag sortable-placeholder" placeholder: "row us-item-row us-item-drag sortable-placeholder"
scroll: true scroll: true
disableHorizontalScroll: true
# A consequence of length of backlog user story item # A consequence of length of backlog user story item
# the default tolerance ("intersection") not works properly. # the default tolerance ("intersection") not works properly.
tolerance: "pointer" tolerance: "pointer"
@ -73,8 +73,11 @@ BacklogSortableDirective = ($repo, $rs, $rootscope, $tgConfirm, $translate) ->
# works unexpectly (in some circumstances calculates wrong # works unexpectly (in some circumstances calculates wrong
# position for revert). # position for revert).
revert: false revert: false
cursorAt: {right: 15} start: () ->
$(document.body).addClass("drag-active")
stop: () -> stop: () ->
$(document.body).removeClass("drag-active")
if $el.hasClass("active-filters") if $el.hasClass("active-filters")
$el.sortable("cancel") $el.sortable("cancel")
filterError() filterError()
@ -167,9 +170,10 @@ SprintSortableDirective = ($repo, $rs, $rootscope) ->
$el.sortable({ $el.sortable({
scroll: true scroll: true
dropOnEmpty: true dropOnEmpty: true
items: ".sprint-table .milestone-us-item-row", items: ".sprint-table .milestone-us-item-row"
connectWith: ".sprint,.backlog-table-body,.empty-backlog", containment: "window"
placeholder: "row us-item-row sortable-placeholder", connectWith: ".sprint,.backlog-table-body,.empty-backlog"
placeholder: "row us-item-row sortable-placeholder"
forcePlaceholderSize:true forcePlaceholderSize:true
}) })

View File

@ -4508,6 +4508,7 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
scroll: true, scroll: true,
scrollSensitivity: 20, scrollSensitivity: 20,
scrollSpeed: 20, scrollSpeed: 20,
disableHorizontalScroll: false,
scope: "default", scope: "default",
tolerance: "intersect", tolerance: "intersect",
zIndex: 1000, zIndex: 1000,
@ -4804,11 +4805,14 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed); scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
} }
// taiga
if (!this.options.disableHorizontalScroll) {
if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) { if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed); scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
} else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) { } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed); scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
} }
}
} }

View File

@ -33,6 +33,10 @@ body {
overflow: hidden; overflow: hidden;
} }
.drag-active {
overflow-x: hidden;
}
.master { .master {
background: $white; background: $white;
height: 100%; height: 100%;