refactored sortByTime filter arguments

test-unit-sauce
Brian Ford 12 years ago
parent e6c28a4c09
commit 033504ffe0

@ -1,10 +1,8 @@
// Sort watchers by time // Sort watchers by time
// Used by the performance tab // Used by the performance tab
panelApp.filter('sortByTime', function () { panelApp.filter('sortByTime', function () {
return function (input, range) { return function (input, min, max) {
var copy = input.slice(0), var copy = input.slice(0);
min = range[0],
max = range[1];
copy = copy.sort(function (a, b) { copy = copy.sort(function (a, b) {
return b.time - a.time; return b.time - a.time;

@ -98,7 +98,7 @@
<h3>Watch Expressions</h3> <h3>Watch Expressions</h3>
<div class="well well-top" style="height: 400px; overflow-y: auto;"> <div class="well well-top" style="height: 400px; overflow-y: auto;">
<div ng-repeat="watch in histogram|sortByTime:[min,max]"> <div ng-repeat="watch in histogram|sortByTime:min:max">
<span style="font-family: monospace;">{{watch.name | first}} </span> <span style="font-family: monospace;">{{watch.name | first}} </span>
<span> | {{watch.percent}}% | {{watch.time}}ms</span> <span> | {{watch.percent}}% | {{watch.time}}ms</span>
<div class="progress"> <div class="progress">