diff --git a/app/coffee/modules/backlog/sortable.coffee b/app/coffee/modules/backlog/sortable.coffee index dcb5460c..75cbd59e 100644 --- a/app/coffee/modules/backlog/sortable.coffee +++ b/app/coffee/modules/backlog/sortable.coffee @@ -42,18 +42,6 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) -> # http://stackoverflow.com/questions/5791886/jquery-draggable-shows- # helper-in-wrong-place-when-scrolled-down-page - # resort = (uses) -> - # items = [] - # for item, index in uses - # item.order = index - # if item.isModified() - # items.push(item) - # - # return items - - # prepareBulkUpdateData = (uses) -> - # return _.map(uses, (x) -> [x.id, x.order]) - linkSortable = ($scope, $el, $attrs, $ctrl) -> # State oldParentScope = null @@ -67,7 +55,6 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) -> itemEl.off() itemEl.remove() - tdom.sortable({ # handle: ".icon-drag-v", items: "div.sprint-table > div.row, .backlog-table-body > div.row" @@ -75,7 +62,6 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) -> tdom.on "sortstop", (event, ui) -> # Common state for stop event handler - parentEl = ui.item.parent() itemEl = ui.item itemUs = itemEl.scope().us diff --git a/app/coffee/modules/backlog/sprints.coffee b/app/coffee/modules/backlog/sprints.coffee index 2101698d..292371f5 100644 --- a/app/coffee/modules/backlog/sprints.coffee +++ b/app/coffee/modules/backlog/sprints.coffee @@ -66,72 +66,6 @@ BacklogSprintDirective = ($repo, $rootscope) -> $el.on "click", ".sprint-name > .icon-edit", (event) -> $rootscope.$broadcast("sprintform:edit", sprint) - ######################### - ## Drag & Drop Link - ######################### - - # linkSortable = ($scope, $el, $attrs, $ctrl) -> - # resortAndSave = -> - # toSave = [] - # for item, i in $scope.sprint.user_stories - # if item.order == i - # continue - # item.order = i - - # toSave = _.filter($scope.sprint.user_stories, (x) -> x.isModified()) - # $repo.saveAll(toSave).then -> - # console.log "FINISHED", arguments - - # onUpdateItem = (event) -> - # item = angular.element(event.item) - # itemScope = item.scope() - - # ids = _.map($scope.sprint.user_stories, {"id": itemScope.us.id}) - # index = ids.indexOf(itemScope.us.id) - - # $scope.sprint.user_stories.splice(index, 1) - # $scope.sprint.user_stories.splice(item.index(), 0, itemScope.us) - # resortAndSave() - - # onAddItem = (event) -> - # item = angular.element(event.item) - # itemScope = item.scope() - # itemIndex = item.index() - - # itemScope.us.milestone = $scope.sprint.id - # userstories = $scope.sprint.user_stories - # userstories.splice(itemIndex, 0, itemScope.us) - - # item.remove() - # item.off() - - # $scope.$apply() - # resortAndSave() - - # onRemoveItem = (event) -> - # item = angular.element(event.item) - # itemScope = item.scope() - - # ids = _.map($scope.sprint.user_stories, "id") - # index = ids.indexOf(itemScope.us.id) - - # if index != -1 - # userstories = $scope.sprint.user_stories - # userstories.splice(index, 1) - - # item.off() - # itemScope.$destroy() - - # dom = $el.find(".sprint-table") - - # sortable = new Sortable(dom[0], { - # group: "backlog", - # selector: ".milestone-us-item-row", - # onUpdate: onUpdateItem, - # onAdd: onAddItem, - # onRemove: onRemoveItem, - # }) - link = ($scope, $el, $attrs) -> $ctrl = $el.closest("div.wrapper").controller() linkCommon($scope, $el, $attrs, $ctrl)