Change restricted of the directive tg-[kanban/taskboard]-user-avatar to A

stable
David Barragán Merino 2014-08-06 15:34:07 +02:00
parent 3c7b9ed490
commit f5527d3941
4 changed files with 10 additions and 16 deletions

View File

@ -293,10 +293,10 @@ KanbanUserDirective = ($log) ->
uniqueId = _.uniqueId("user_photo")
link = ($scope, $el, $attrs) ->
if not $attrs.model?
return $log.error "KanbanUserDirective: no model attr is defined"
if not $attrs.tgKanbanUserAvatar
return $log.error "KanbanUserDirective: no attr is defined"
wtid = $scope.$watch $attrs.model, (v) ->
wtid = $scope.$watch $attrs.tgKanbanUserAvatar, (v) ->
if not $scope.usersById?
$log.error "KanbanUserDirective requires userById set in scope."
wtid()
@ -320,10 +320,7 @@ KanbanUserDirective = ($log) ->
$scope.$apply ->
$scope.$eval($attrs.click)
return {
link: link
restrict: "AE"
}
return {link: link}
module.directive("tgKanbanUserAvatar", ["$log", KanbanUserDirective])

View File

@ -240,10 +240,10 @@ TaskboardUserDirective = ($log) ->
uniqueId = _.uniqueId("user_photo")
link = ($scope, $el, $attrs) ->
if not $attrs.model?
return $log.error "TaskboardUserDirective: no model attr is defined"
if not $attrs.tgTaskboardUserAvatar?
return $log.error "TaskboardUserDirective: no attr is defined"
wtid = $scope.$watch $attrs.model, (v) ->
wtid = $scope.$watch $attrs.tgTaskboardUserAvatar, (v) ->
if not $scope.usersById?
$log.error "TaskboardUserDirective requires userById set in scope."
wtid()
@ -268,10 +268,7 @@ TaskboardUserDirective = ($log) ->
$scope.$apply ->
$scope.$eval($attrs.click)
return {
link: link
restrict: "AE"
}
return {link: link}
module.directive("tgTaskboardUserAvatar", ["$log", TaskboardUserDirective])

View File

@ -1,7 +1,7 @@
div.kanban-tagline
a.taskboard-tag(ng-repeat="tag in us.tags", href="", tg-bo-title="tag", tg-colorize-tag="tag")
div.kanban-task-inner
tg-kanban-user-avatar(model="us.assigned_to", click="ctrl.changeUsAssignedTo(us)")
div(tg-kanban-user-avatar="us.assigned_to", click="ctrl.changeUsAssignedTo(us)")
div.task-text
span.task-num(tg-bo-ref="us.ref")
a.task-name(href="", title="", tg-bind-html="us.subject",

View File

@ -1,7 +1,7 @@
div.taskboard-tagline
a.taskboard-tag(ng-repeat="tag in task.tags", href="", tg-bo-title="tag", tg-colorize-tag="tag")
div.taskboard-task-inner
tg-taskboard-user-avatar(model="task.assigned_to", click="ctrl.editTaskAssignedTo(task)")
div(tg-taskboard-user-avatar="task.assigned_to", click="ctrl.editTaskAssignedTo(task)")
p.taskboard-text
span.task-num(tg-bo-ref="task.ref")
a.task-name(href="", title="See task details", tg-bind-html="task.subject",