crosbymichael/dockerui#194 fix toggleAll function by only iterating over filtered objects

Signed-off-by: Philip Miglinci <p.miglinci@gmail.com>
pull/2/head
Philip Miglinci 2016-03-25 15:29:39 +01:00
parent 8cdb675abc
commit d2bc18b575
8 changed files with 9 additions and 9 deletions

View File

@ -64,7 +64,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="container in containers | filter:filter | orderBy:sortType:sortReverse">
<tr ng-repeat="container in (filteredContainers = ( containers | filter:filter | orderBy:sortType:sortReverse))">
<td><input type="checkbox" ng-model="container.Checked" /></td>
<td><a href="#/containers/{{ container.Id }}/">{{ container|containername}}</a></td>
<td><a href="#/images/{{ container.Image }}/">{{ container.Image }}</a></td>

View File

@ -6,7 +6,7 @@ angular.module('containers', [])
$scope.toggle = false;
$scope.displayAll = Settings.displayAll;
$scope.order = function(sortType) {
$scope.order = function (sortType) {
$scope.sortReverse = ($scope.sortType === sortType) ? !$scope.sortReverse : false;
$scope.sortType = sortType;
};
@ -76,7 +76,7 @@ angular.module('containers', [])
};
$scope.toggleSelectAll = function () {
angular.forEach($scope.containers, function (i) {
angular.forEach($scope.filteredContainers, function (i) {
i.Checked = $scope.toggle;
});
};

View File

@ -53,7 +53,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="image in images | filter:filter | orderBy:sortType:sortReverse">
<tr ng-repeat="image in (filteredImages = (images | filter:filter | orderBy:sortType:sortReverse))">
<td><input type="checkbox" ng-model="image.Checked" /></td>
<td><a href="#/images/{{ image.Id }}/?tag={{ image|repotag }}">{{ image.Id|truncate:20}}</a></td>
<td>{{ image|repotag }}</td>

View File

@ -42,7 +42,7 @@ angular.module('images', [])
};
$scope.toggleSelectAll = function () {
angular.forEach($scope.images, function (i) {
angular.forEach($scope.filteredImages, function (i) {
i.Checked = $scope.toggle;
});
};

View File

@ -72,7 +72,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="network in networks | filter:filter | orderBy:sortType:sortReverse">
<tr ng-repeat="network in ( filteredNetworks = (networks | filter:filter | orderBy:sortType:sortReverse))">
<td><input type="checkbox" ng-model="network.Checked"/></td>
<td><a href="#/networks/{{ network.Id }}/">{{ network.Name|truncate:20}}</a></td>
<td>{{ network.Id }}</td>

View File

@ -52,7 +52,7 @@ angular.module('networks', []).config(['$routeProvider', function ($routeProvide
};
$scope.toggleSelectAll = function () {
angular.forEach($scope.networks, function (i) {
angular.forEach($scope.filteredNetworks, function (i) {
i.Checked = $scope.toggle;
});
};

View File

@ -44,7 +44,7 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="volume in volumes | filter:filter | orderBy:sortType:sortReverse">
<tr ng-repeat="volume in (filteredVolumes = (volumes | filter:filter | orderBy:sortType:sortReverse))">
<td><input type="checkbox" ng-model="volume.Checked"/></td>
<td>{{ volume.Name|truncate:20 }}</td>
<td>{{ volume.Driver }}</td>

View File

@ -45,7 +45,7 @@ angular.module('volumes', []).config(['$routeProvider', function ($routeProvider
};
$scope.toggleSelectAll = function () {
angular.forEach($scope.volumes, function (i) {
angular.forEach($scope.filteredVolumes, function (i) {
i.Checked = $scope.toggle;
});
};