mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add row clicking in the projects list.
This commit is contained in:
parent
208f021bd0
commit
d71296da9f
2 changed files with 21 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
}
|
Loading…
Reference in a new issue