diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-12-07 11:49:49 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-12-07 11:49:49 -0500 |
commit | 56f5841d4b9c12296cdfcaeff174b2627d59afc8 (patch) | |
tree | 4f7da4ebbe5ee15a1594b26466ed78e2cf10de35 /app/assets/javascripts/pokemon.js.coffee | |
parent | c1b0443ba2aebdbd39291ddab0c189f3f4831320 (diff) | |
download | pokeviewer-56f5841d4b9c12296cdfcaeff174b2627d59afc8.tar.gz pokeviewer-56f5841d4b9c12296cdfcaeff174b2627d59afc8.tar.bz2 pokeviewer-56f5841d4b9c12296cdfcaeff174b2627d59afc8.zip |
Migrate to full rails app
Diffstat (limited to 'app/assets/javascripts/pokemon.js.coffee')
-rw-r--r-- | app/assets/javascripts/pokemon.js.coffee | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/assets/javascripts/pokemon.js.coffee b/app/assets/javascripts/pokemon.js.coffee new file mode 100644 index 0000000..e80ae77 --- /dev/null +++ b/app/assets/javascripts/pokemon.js.coffee | |||
@@ -0,0 +1,19 @@ | |||
1 | show_pokemon_tab = (tab) -> | ||
2 | $(".pokemon-tab").hide() | ||
3 | $(".ptabe-button").removeClass("active") | ||
4 | $(".pokemon-" + tab).show() | ||
5 | $(".ptabe-" + tab).addClass("active") | ||
6 | |||
7 | $ -> | ||
8 | $(".pkv-has-hover").mouseover -> | ||
9 | $(this).children(".pkv-hover").show() | ||
10 | $(".pkv-has-hover").mouseout -> | ||
11 | $(this).children(".pkv-hover").hide() | ||
12 | $(".pkv-has-hover").mousemove (event) -> | ||
13 | $(this).children(".pkv-hover").offset({left: event.pageX + 16, top: event.pageY - 16}) | ||
14 | $(".in-emerald .pokemon-image img").mouseover -> | ||
15 | $(this).attr("src", $(this)[0].src) | ||
16 | $(".ptabe-button a").click -> | ||
17 | show_pokemon_tab($(this).data("tab")) | ||
18 | if $("#pokemon-embed").length > 0 | ||
19 | show_pokemon_tab("details") | ||