diff options
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") | ||