From dfc1002d0b55e4a88e8bae8ee0319d75dc44a5e8 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 3 Feb 2015 12:49:21 +0100 Subject: [PATCH] fix backlog sort with doomline --- app/coffee/modules/backlog/sortable.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/coffee/modules/backlog/sortable.coffee b/app/coffee/modules/backlog/sortable.coffee index d11ac1c1..ac0cc1ac 100644 --- a/app/coffee/modules/backlog/sortable.coffee +++ b/app/coffee/modules/backlog/sortable.coffee @@ -45,6 +45,9 @@ BacklogSortableDirective = ($repo, $rs, $rootscope, $tgConfirm) -> # helper-in-wrong-place-when-scrolled-down-page link = ($scope, $el, $attrs) -> + getUsIndex = (us) => + return $(us).index(".backlog-table-body .row") + bindOnce $scope, "project", (project) -> # If the user has not enough permissions we don't enable the sortable if not (project.my_permissions.indexOf("modify_us") > -1) @@ -83,7 +86,7 @@ BacklogSortableDirective = ($repo, $rs, $rootscope, $tgConfirm) -> return itemUs = ui.item.scope().us - itemIndex = ui.item.index() + itemIndex = getUsIndex(ui.item) deleteElement(ui.item) @@ -99,7 +102,7 @@ BacklogSortableDirective = ($repo, $rs, $rootscope, $tgConfirm) -> return $(item).index() index = _.min _.map items, (item) -> - return $(item).index() + return getUsIndex(item) us = _.map items, (item) -> item = $(item)