diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-07-04 14:42:21 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-07-04 14:42:21 -0400 |
commit | a70494be4e1767e0cb7ff4218e7f266ece56089c (patch) | |
tree | 9e9c93272e8ed4d55091ba4a61f2787e1229a958 /app/assets/javascripts | |
parent | 006cf8cebfb4e2d2dcfc537b6d3ccaaa14e28cfc (diff) | |
download | pokeviewer-a70494be4e1767e0cb7ff4218e7f266ece56089c.tar.gz pokeviewer-a70494be4e1767e0cb7ff4218e7f266ece56089c.tar.bz2 pokeviewer-a70494be4e1767e0cb7ff4218e7f266ece56089c.zip |
Made pokemon embeddable
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/pokeviewer/pokemon.js.coffee | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/pokeviewer/pokemon.js.coffee b/app/assets/javascripts/pokeviewer/pokemon.js.coffee index a6fd326..e80ae77 100644 --- a/app/assets/javascripts/pokeviewer/pokemon.js.coffee +++ b/app/assets/javascripts/pokeviewer/pokemon.js.coffee | |||
@@ -1,3 +1,9 @@ | |||
1 | show_pokemon_tab = (tab) -> | ||
2 | $(".pokemon-tab").hide() | ||
3 | $(".ptabe-button").removeClass("active") | ||
4 | $(".pokemon-" + tab).show() | ||
5 | $(".ptabe-" + tab).addClass("active") | ||
6 | |||
1 | $ -> | 7 | $ -> |
2 | $(".pkv-has-hover").mouseover -> | 8 | $(".pkv-has-hover").mouseover -> |
3 | $(this).children(".pkv-hover").show() | 9 | $(this).children(".pkv-hover").show() |
@@ -7,3 +13,7 @@ $ -> | |||
7 | $(this).children(".pkv-hover").offset({left: event.pageX + 16, top: event.pageY - 16}) | 13 | $(this).children(".pkv-hover").offset({left: event.pageX + 16, top: event.pageY - 16}) |
8 | $(".in-emerald .pokemon-image img").mouseover -> | 14 | $(".in-emerald .pokemon-image img").mouseover -> |
9 | $(this).attr("src", $(this)[0].src) | 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") | ||