summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/wwwroot/Content/js
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-10-20 20:57:27 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-10-20 20:57:27 -0400
commit54ab7dd6b337b0b9fc0a7d9e1017fa1faca972e0 (patch)
treec026f7dbef026af47fbdbdbcaeca7dfe15232c22 /src/SMAPI.Web/wwwroot/Content/js
parentd2db5e3b1d62cb8c17bf4d26ab3cdc47afde5033 (diff)
downloadSMAPI-54ab7dd6b337b0b9fc0a7d9e1017fa1faca972e0.tar.gz
SMAPI-54ab7dd6b337b0b9fc0a7d9e1017fa1faca972e0.tar.bz2
SMAPI-54ab7dd6b337b0b9fc0a7d9e1017fa1faca972e0.zip
minor fixes (#597)
Diffstat (limited to 'src/SMAPI.Web/wwwroot/Content/js')
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/mods.js30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/js/mods.js b/src/SMAPI.Web/wwwroot/Content/js/mods.js
index 690b81df..1af53906 100644
--- a/src/SMAPI.Web/wwwroot/Content/js/mods.js
+++ b/src/SMAPI.Web/wwwroot/Content/js/mods.js
@@ -33,6 +33,25 @@ smapi.modList = function (mods) {
app = new Vue({
el: "#app",
data: data,
+ mounted: function() {
+ // enable table sorting
+ $("#mod-list").tablesorter({
+ cssHeader: "header",
+ cssAsc: "headerSortUp",
+ cssDesc: "headerSortDown"
+ });
+
+ // put focus in textbox for quick search
+ if (!location.hash)
+ $("#search-box").focus();
+
+ // jump to anchor (since table is added after page load)
+ if (location.hash) {
+ var row = $(location.hash).get(0);
+ if (row)
+ row.scrollIntoView();
+ }
+ },
methods: {
/**
* Update the visibility of all mods based on the current search text.
@@ -57,15 +76,4 @@ smapi.modList = function (mods) {
}
}
});
-
- // put focus in textbox for quick search
- if (!location.hash)
- $("#search-box").focus();
-
- // enable table sorting
- $("#mod-list").tablesorter({
- cssHeader: "header",
- cssAsc: "headerSortUp",
- cssDesc: "headerSortDown"
- });
};