1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-04 13:25:26 +02:00

feat (container): remember selection when refreshing a list view (#151) (#567)

This commit is contained in:
Romain 2017-02-15 23:08:18 +01:00 committed by Anthony Lapenna
parent f1c458b147
commit 6f53d1a35a
2 changed files with 21 additions and 2 deletions

View file

@ -0,0 +1,15 @@
angular.module('portainer.services')
.factory('EntityListService', [function EntityListServiceFactory() {
'use strict';
return {
rememberPreviousSelection: function(oldContainerList, model, onSelectCallback) {
var oldModel = _.find(oldContainerList, function(item){
return item.Id === model.Id;
});
if (oldModel && oldModel.Checked) {
model.Checked = true;
onSelectCallback(model);
}
}
};
}]);