Remove commented code.
parent
3fb2cdf709
commit
6d4dc6f242
|
@ -42,18 +42,6 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) ->
|
||||||
# http://stackoverflow.com/questions/5791886/jquery-draggable-shows-
|
# http://stackoverflow.com/questions/5791886/jquery-draggable-shows-
|
||||||
# helper-in-wrong-place-when-scrolled-down-page
|
# 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) ->
|
linkSortable = ($scope, $el, $attrs, $ctrl) ->
|
||||||
# State
|
# State
|
||||||
oldParentScope = null
|
oldParentScope = null
|
||||||
|
@ -67,7 +55,6 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) ->
|
||||||
itemEl.off()
|
itemEl.off()
|
||||||
itemEl.remove()
|
itemEl.remove()
|
||||||
|
|
||||||
|
|
||||||
tdom.sortable({
|
tdom.sortable({
|
||||||
# handle: ".icon-drag-v",
|
# handle: ".icon-drag-v",
|
||||||
items: "div.sprint-table > div.row, .backlog-table-body > div.row"
|
items: "div.sprint-table > div.row, .backlog-table-body > div.row"
|
||||||
|
@ -75,7 +62,6 @@ BacklogSortableDirective = ($repo, $rs, $rootscope) ->
|
||||||
|
|
||||||
tdom.on "sortstop", (event, ui) ->
|
tdom.on "sortstop", (event, ui) ->
|
||||||
# Common state for stop event handler
|
# Common state for stop event handler
|
||||||
|
|
||||||
parentEl = ui.item.parent()
|
parentEl = ui.item.parent()
|
||||||
itemEl = ui.item
|
itemEl = ui.item
|
||||||
itemUs = itemEl.scope().us
|
itemUs = itemEl.scope().us
|
||||||
|
|
|
@ -66,72 +66,6 @@ BacklogSprintDirective = ($repo, $rootscope) ->
|
||||||
$el.on "click", ".sprint-name > .icon-edit", (event) ->
|
$el.on "click", ".sprint-name > .icon-edit", (event) ->
|
||||||
$rootscope.$broadcast("sprintform:edit", sprint)
|
$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) ->
|
link = ($scope, $el, $attrs) ->
|
||||||
$ctrl = $el.closest("div.wrapper").controller()
|
$ctrl = $el.closest("div.wrapper").controller()
|
||||||
linkCommon($scope, $el, $attrs, $ctrl)
|
linkCommon($scope, $el, $attrs, $ctrl)
|
||||||
|
|
Loading…
Reference in New Issue