summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/wwwroot/Content/js
diff options
context:
space:
mode:
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"
- });
};