update mod list filters to always display clicked mod link

This commit is contained in:
Jesse Plamondon-Willard 2019-05-15 20:51:28 -04:00
parent 8595a2a6fa
commit 77f85a701a
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
3 changed files with 12 additions and 4 deletions

View File

@ -7,6 +7,9 @@ These changes have not been released yet.
* SMAPI now prevents invalid event preconditions from crashing the game (thanks to berkayylmao!).
* Fixed errors during early startup not shown before exit.
* For the web UI:
* When filtering the mod list, clicking a mod link now automatically adds it to the visible mods.
* For modders:
* `this.Monitor.Log` now defaults to the `Trace` log level instead of `Debug`.
* Fixed 'location list changed' verbose log not correctly listing changes.

View File

@ -17,10 +17,10 @@
{
<meta name="robots" content="noindex" />
}
<link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190314" />
<link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190515" />
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" crossorigin="anonymous"></script>
<script src="~/Content/js/log-parser.js?r=20190310"></script>
<script src="~/Content/js/log-parser.js?r=20190515"></script>
<script>
$(function() {
smapi.logParser({

View File

@ -87,8 +87,6 @@ smapi.modList = function (mods, enableBeta) {
else
delete data.filters.betaStatus;
window.boop = data.filters;
// init mods
for (var i = 0; i < data.mods.length; i++) {
var mod = mods[i];
@ -188,6 +186,10 @@ smapi.modList = function (mods, enableBeta) {
matchesFilters: function(mod, searchWords) {
var filters = data.filters;
// check hash
if (location.hash === "#" + mod.Slug)
return true;
// check source
if (!filters.source.value.open.value && mod.SourceUrl)
return false;
@ -281,4 +283,7 @@ smapi.modList = function (mods, enableBeta) {
}
});
app.applyFilters();
window.addEventListener("hashchange", function () {
app.applyFilters();
});
};