update mod list filters to always display clicked mod link
This commit is contained in:
parent
8595a2a6fa
commit
77f85a701a
|
@ -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.
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue