mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
basic sorting added to project list page
This commit is contained in:
parent
c683eab9e2
commit
ca6e8a7d40
2 changed files with 10 additions and 6 deletions
|
@ -122,13 +122,13 @@
|
|||
select-all,
|
||||
type="checkbox"
|
||||
)
|
||||
span.header Title
|
||||
span.header(ng-click="changePredicate('name')") Title
|
||||
.col-md-2
|
||||
span.header Owner
|
||||
span.header(ng-click="changePredicate('accessLevel')") Owner
|
||||
.col-md-4
|
||||
span.header Last Modified
|
||||
span.header(ng-click="changePredicate('lastUpdated')") Last Modified
|
||||
li.project_entry.container-fluid(
|
||||
ng-repeat="project in visibleProjects | orderBy:'lastUpdated':true",
|
||||
ng-repeat="project in visibleProjects | orderBy:predicate:reverse",
|
||||
ng-controller="ProjectListItemController"
|
||||
)
|
||||
.row
|
||||
|
|
|
@ -57,6 +57,8 @@ define [
|
|||
$scope.allSelected = false
|
||||
$scope.selectedProjects = []
|
||||
$scope.filter = "all"
|
||||
$scope.predicate = "lastUpdated"
|
||||
$scope.reverse = false
|
||||
|
||||
$scope.windowHeight = $window.innerHeight
|
||||
angular.element($window).bind "resize", () ->
|
||||
|
@ -75,8 +77,10 @@ define [
|
|||
project.tags ||= []
|
||||
project.tags.push tag
|
||||
|
||||
$scope.$watch "searchText", (value) ->
|
||||
$scope.updateVisibleProjects()
|
||||
$scope.changePredicate = (newPredicate)->
|
||||
if $scope.predicate == newPredicate
|
||||
$scope.reverse = !$scope.reverse
|
||||
$scope.predicate = newPredicate
|
||||
|
||||
$scope.clearSearchText = () ->
|
||||
$scope.searchText = ""
|
||||
|
|
Loading…
Reference in a new issue