Add row clicking in the projects list.

This commit is contained in:
Paulo Reis 2017-05-01 17:11:03 +01:00
parent 208f021bd0
commit d71296da9f
2 changed files with 21 additions and 2 deletions

View file

@ -140,20 +140,25 @@
ng-repeat="project in visibleProjects | orderBy:predicate:reverse",
ng-controller="ProjectListItemController"
)
.row
.row(select-row)
.col-xs-6
input.select-item(
select-individual,
type="checkbox",
ng-model="project.selected"
stop-propagation="click"
)
span
a.projectName(href="/project/{{project.id}}") {{project.name}}
a.projectName(
href="/project/{{project.id}}"
stop-propagation="click"
) {{project.name}}
span(
ng-controller="TagListController"
)
.tag-label(
ng-repeat='tag in project.tags'
stop-propagation="click"
)
a.label.label-default.tag-label-name(
href,

View file

@ -58,4 +58,18 @@ define [
scope.$apply () ->
scope.ngModel = false
ignoreChanges = false
scope.$on "select-all:row-clicked", () ->
ignoreChanges = true
scope.$apply () ->
scope.ngModel = !scope.ngModel
ignoreChanges = false
}
App.directive "selectRow", () ->
return {
scope: true
link: (scope, element, attrs) ->
element.on "click", (e) ->
scope.$broadcast "select-all:row-clicked"
}