mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added search query minifying
Seeing 'page=1' and 'query=' in every other link was tiresome. I changed the rules so that such keys are appended only if they hold nontrivial values.
This commit is contained in:
@ -41,7 +41,11 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) {
|
||||
if (position + direction >= 0 && position + direction < postIds.length) {
|
||||
var url = util.appendComplexRouteParam(
|
||||
'#/post/' + postIds[position + direction],
|
||||
_.extend({page: page}, pager.getSearchParams()));
|
||||
util.simplifySearchQuery(
|
||||
_.extend(
|
||||
{page: page},
|
||||
pager.getSearchParams())));
|
||||
|
||||
resolve(url);
|
||||
} else if (page + direction >= 1) {
|
||||
pager.setPage(page + direction);
|
||||
@ -54,7 +58,11 @@ App.Services.PostsAroundCalculator = function(_, promise, util, pager) {
|
||||
|
||||
var url = util.appendComplexRouteParam(
|
||||
'#/post/' + post.id,
|
||||
_.extend({page: page + direction}, pager.getSearchParams()));
|
||||
util.simplifySearchQuery(
|
||||
_.extend(
|
||||
{page: page + direction},
|
||||
pager.getSearchParams())));
|
||||
|
||||
resolve(url);
|
||||
} else {
|
||||
resolve(null);
|
||||
|
Reference in New Issue
Block a user