harbor/static/resources/js/layout/details/details.config.js

32 lines
668 B
JavaScript
Raw Normal View History

2016-04-18 10:33:30 +02:00
(function() {
'use strict';
angular
.module('harbor.details')
.filter('name', nameFilter);
function nameFilter() {
return filter;
function filter(input, filterInput, key) {
input = input || [];
var filteredResults = [];
2016-05-23 12:29:17 +02:00
if (filterInput !== '') {
for(var i = 0; i < input.length; i++) {
var item = input[i];
2016-05-23 12:29:17 +02:00
if((key === "" && item.indexOf(filterInput) >= 0) || (key !== "" && item[key].indexOf(filterInput) >= 0)) {
filteredResults.push(item);
continue;
}
}
input = filteredResults;
}
return input;
}
}
2016-04-28 19:36:39 +02:00
2016-04-18 10:33:30 +02:00
})();