moved slice to filter, should be faster

This commit is contained in:
Rashid Khan
2013-07-22 21:50:57 -07:00
parent 6c62a9b841
commit cc5da00bd0
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -20,4 +20,10 @@ angular.module('kibana.filters', [])
});
return ret;
};
}).filter('slice', function() {
return function(arr, start, end) {
if(!_.isUndefined(arr)) {
return arr.slice(start, end);
}
};
});
+1 -1
View File
@@ -34,7 +34,7 @@
</th>
</thead>
<tbody ng-repeat="row in data.slice(panel.offset,panel.offset+panel.size)" ng-class-odd="'odd'">
<tbody ng-repeat="row in data | slice:panel.offset:panel.offset+panel.size" ng-class-odd="'odd'">
<tr ng-click="toggle_details(row)" class="pointer">
<td ng-repeat="field in panel.fields" ng-bind-html-unsafe="(row.highlight[field]||row._source[field]) | highlight"></td>
</tr>