<div class="col-md-1" ng-if="!disableMultiSort">
[% l('Sort Priority') %]
</div>
+ <div class="col-md-3">
+ <button class="btn btn-default" ng-click="elevateVisible()">
+ [% l('Sort Visible Columns To Top') %]
+ </button>
+ </div>
</div>
<div class="row" ng-repeat="col in columns"
ng-class="{visible : col.visible}">
$dialogScope.modifyColumnPos = $scope.modifyColumnPos;
$dialogScope.disableMultiSort = $scope.disableMultiSort;
$dialogScope.columns = $scope.columns;
+
+ // Push visible columns to the top of the list
+ $dialogScope.elevateVisible = function() {
+ var new_cols = [];
+ angular.forEach($dialogScope.columns, function(col) {
+ if (col.visible) new_cols.push(col);
+ });
+ angular.forEach($dialogScope.columns, function(col) {
+ if (!col.visible) new_cols.push(col);
+ });
+
+ // Update all references to the list of columns
+ $dialogScope.columns =
+ $scope.columns =
+ grid.columnsProvider.columns =
+ new_cols;
+ }
+
$dialogScope.toggle = function(col) {
col.visible = !Boolean(col.visible);
}
$dialogScope.ok = $dialogScope.cancel = function() {
+ delete $scope.lastModColumn;
$uibModalInstance.close()
}
}