summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/wwwroot/Content/js
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-16 14:47:37 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-16 14:47:37 -0400
commit450147e9fb906aee8dbc60ee26a6963da03b257b (patch)
treef49f460c8ec05f9f7b7af78c7932a40f54d941ae /src/SMAPI.Web/wwwroot/Content/js
parent6c08f774250b252c09b282a663b3947acb3a6741 (diff)
parentdc27247b28097a992694fcb7a72133ae4e56e27b (diff)
downloadSMAPI-450147e9fb906aee8dbc60ee26a6963da03b257b.tar.gz
SMAPI-450147e9fb906aee8dbc60ee26a6963da03b257b.tar.bz2
SMAPI-450147e9fb906aee8dbc60ee26a6963da03b257b.zip
Merge branch 'feature/nexus-links' into develop
Diffstat (limited to 'src/SMAPI.Web/wwwroot/Content/js')
-rw-r--r--src/SMAPI.Web/wwwroot/Content/js/index.js27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/SMAPI.Web/wwwroot/Content/js/index.js b/src/SMAPI.Web/wwwroot/Content/js/index.js
index 016d5fa4..d0734b02 100644
--- a/src/SMAPI.Web/wwwroot/Content/js/index.js
+++ b/src/SMAPI.Web/wwwroot/Content/js/index.js
@@ -1,11 +1,34 @@
$(document).ready(function () {
+ /* enable pufferchick */
var pufferchick = $("#pufferchick");
- $(".download").hover(
+ $(".cta-dropdown").hover(
function () {
pufferchick.attr("src", "Content/images/pufferchick-cool.png");
},
function () {
- pufferchick.attr("src", "favicon.ico");
+ pufferchick.attr("src", "Content/images/pufferchick.png");
}
);
+
+ /* enable download dropdowns */
+ $(".cta-dropdown a.download").each(function(i, button) {
+ button = $(button);
+ var wrapper = button.parent(".cta-dropdown");
+ var button = wrapper.find(".download");
+ var dropdownContent = wrapper.find(".dropdown-content");
+
+ $(window).on("click", function(e) {
+ var target = $(e.target);
+
+ // toggle dropdown on button click
+ if (target.is(button) || $.contains(button.get(0), target.get(0))) {
+ e.preventDefault();
+ dropdownContent.toggle();
+ }
+
+ // else hide dropdown
+ else
+ dropdownContent.hide();
+ });
+ });
});