List view editor, makes sorting work
This commit is contained in:
@@ -25,17 +25,19 @@ angular.module("umbraco")
|
||||
$scope.reloadView();
|
||||
};
|
||||
|
||||
$scope.sort = function(field){
|
||||
$scope.options.sortby = field;
|
||||
$scope.sort = function (field) {
|
||||
|
||||
$scope.options.orderBy = field;
|
||||
|
||||
if(field !== $scope.options.sortby){
|
||||
if($scope.options.order === "desc"){
|
||||
$scope.options.order = "asc";
|
||||
}else{
|
||||
$scope.options.order = "desc";
|
||||
}
|
||||
|
||||
if ($scope.options.orderDirection === "desc") {
|
||||
$scope.options.orderDirection = "asc";
|
||||
}else{
|
||||
$scope.options.orderDirection = "desc";
|
||||
}
|
||||
$scope.reloadView();
|
||||
|
||||
|
||||
$scope.reloadView($scope.content.id);
|
||||
};
|
||||
|
||||
$scope.prev = function(){
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<td with="20"><input type="checkbox"></td>
|
||||
<td><a href="#" ng-click="sort('name')" prevent-default>Name <i class="icon-sort"></i></a></td>
|
||||
<td><a href="#" ng-click="sort('updateDate')" prevent-default>Last updated <i class="icon-sort"></i></a></td>
|
||||
<td><a href="#" ng-click="sort('owner')" prevent-default>Editor <i class="icon-sort"></i></a></td>
|
||||
<td><a href="#" ng-click="sort('Name')" prevent-default>Name <i class="icon-sort"></i></a></td>
|
||||
<td><a href="#" ng-click="sort('UpdateDate')" prevent-default>Last updated <i class="icon-sort"></i></a></td>
|
||||
<td><a href="#" ng-click="sort('Owner')" prevent-default>Editor <i class="icon-sort"></i></a></td>
|
||||
<td with="20"><form class="pull-right" novalidate>
|
||||
<i class="icon-search"></i>
|
||||
<input type="text" ng-model="options.filter" on-keyup="reloadView()">
|
||||
|
||||
Reference in New Issue
Block a user