Load data from the project object instead from the api

stable
David Barragán Merino 2014-10-27 15:40:47 +01:00
parent a58d3b7098
commit a412f5ec7b
1 changed files with 20 additions and 22 deletions

View File

@ -196,17 +196,16 @@ LbTagLineDirective = ($rs) ->
menu.css("top", position.top)
menu.css("left", position.left)
$rs.projects.tags(project.id).then (data) ->
$el.find("input").autocomplete({
source: data
position: {
my: "left top",
using: positioningFunction
}
select: (event, ui) ->
addValue(ui.item.value)
ui.item.value = ""
})
$el.find("input").autocomplete({
source: _.keys(project.tags_colors)
position: {
my: "left top",
using: positioningFunction
}
select: (event, ui) ->
addValue(ui.item.value)
ui.item.value = ""
})
$scope.$watch $attrs.ngModel, (tags) ->
tagsColors = $scope.project?.tags_colors or []
@ -384,17 +383,16 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm) ->
menu.css("top", position.top)
menu.css("left", position.left)
$rs.projects.tags(project.id).then (data) ->
$el.find("input").autocomplete({
source: data
position: {
my: "left top",
using: positioningFunction
}
select: (event, ui) ->
addValue(ui.item.value)
ui.item.value = ""
})
$el.find("input").autocomplete({
source: _.keys(project.tags_colors)
position: {
my: "left top",
using: positioningFunction
}
select: (event, ui) ->
addValue(ui.item.value)
ui.item.value = ""
})
$scope.$watch $attrs.ngModel, (model) ->
return if not model