diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-21 20:59:35 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-21 20:59:35 -0400 |
commit | 4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b (patch) | |
tree | d8daaf8ec431b0b13b8d00901bda0268a72f895b /src/SMAPI.Web/wwwroot/Content/js/log-parser.js | |
parent | c05505646048d8f7aaabfb65bd1e789e94857d65 (diff) | |
download | SMAPI-4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b.tar.gz SMAPI-4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b.tar.bz2 SMAPI-4fa414c2bd5ddb452c0560d00e0d4f1d383c1d8b.zip |
set page/perPage URL args together
Since there's no UI to set the page size, this makes the argument more discoverable.
Diffstat (limited to 'src/SMAPI.Web/wwwroot/Content/js/log-parser.js')
-rw-r--r-- | src/SMAPI.Web/wwwroot/Content/js/log-parser.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js index 3fb5fd6c..fccd00be 100644 --- a/src/SMAPI.Web/wwwroot/Content/js/log-parser.js +++ b/src/SMAPI.Web/wwwroot/Content/js/log-parser.js @@ -743,11 +743,14 @@ smapi.logParser = function (state) { updateUrl: function () { const url = new URL(location); - if (state.page != 1) + if (state.page != 1 || state.perPage != defaultPerPage) { url.searchParams.set("Page", state.page); - - if (state.perPage != defaultPerPage) url.searchParams.set("PerPage", state.perPage); + } + else { + url.searchParams.delete("Page"); + url.searchParams.delete("PerPage"); + } if (!helpers.shallowEquals(this.showMods, state.defaultMods)) url.searchParams.set("Mods", Object.entries(this.showMods).filter(p => p[1]).map(p => p[0]).join("~")); |