// Generated by CoffeeScript 1.12.7
/**
* Volume search
* @mixin volume/search
*/
'use strict';
app.controller('volume/search', [
'$scope', '$location', 'displayService', 'volumes', function($scope, $location, display, volumes) {
var limit, offset;
limit = 25 - 1;
offset = parseInt($location.search().offset, 10) || 0;
display.title = 'Search';
$scope.volumes = volumes;
$scope.number = 1 + (offset / limit);
if (volumes.length > limit) {
$scope.next = function() {
return $location.search('offset', offset + limit);
};
$scope.volumes.pop();
}
if (offset > 0) {
$scope.prev = function() {
return $location.search('offset', Math.max(0, offset - limit));
};
}
}
]);
//# sourceMappingURL=search.js.map