From f5527d3941bac3a4b7a6f80950e7a7e00d4dc8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 6 Aug 2014 15:34:07 +0200 Subject: [PATCH] Change restricted of the directive tg-[kanban/taskboard]-user-avatar to A --- app/coffee/modules/kanban/main.coffee | 11 ++++------- app/coffee/modules/taskboard/main.coffee | 11 ++++------- app/partials/views/components/kanban-task.jade | 2 +- app/partials/views/components/taskboard-task.jade | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/app/coffee/modules/kanban/main.coffee b/app/coffee/modules/kanban/main.coffee index f6241abb..c36e2c9c 100644 --- a/app/coffee/modules/kanban/main.coffee +++ b/app/coffee/modules/kanban/main.coffee @@ -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]) diff --git a/app/coffee/modules/taskboard/main.coffee b/app/coffee/modules/taskboard/main.coffee index e28a80f0..9099f987 100644 --- a/app/coffee/modules/taskboard/main.coffee +++ b/app/coffee/modules/taskboard/main.coffee @@ -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]) diff --git a/app/partials/views/components/kanban-task.jade b/app/partials/views/components/kanban-task.jade index efed200c..46eb1a59 100644 --- a/app/partials/views/components/kanban-task.jade +++ b/app/partials/views/components/kanban-task.jade @@ -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", diff --git a/app/partials/views/components/taskboard-task.jade b/app/partials/views/components/taskboard-task.jade index 246fc235..77cf25b5 100644 --- a/app/partials/views/components/taskboard-task.jade +++ b/app/partials/views/components/taskboard-task.jade @@ -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",