mkdru.removeLimit = function (facet, limit) {
var newHash = $.deparam.fragment();
delete newHash['page'];
- if (!newHash['limit_' + facet].indexOf(';') || !mkdru.facets[facet].multiLimit) {
+ if (!newHash['limit_' + facet].indexOf(';')
+ || !mkdru.facets[facet].multiLimit) {
delete newHash['limit_' + facet];
}
else {
for (var i = 0; i < limits.length; i++) {
if (limits[i] == limit) {
limits.splice(i, 1);
- newHash['limit_' + facet] = limits.join(';');
+ if (limits.length < 1)
+ delete newHash['limit_' + facet];
+ else
+ newHash['limit_' + facet] = limits.join(';');
break;
}
}