From 2721f3768ebd4d279caa967bee210249d93f92cb Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 24 Sep 2017 18:14:24 -0400 Subject: Worked on PC display page --- app/assets/javascripts/pokeviewer/application.js | 1 + app/assets/javascripts/pokeviewer/pokemon.js | 2 -- app/assets/javascripts/pokeviewer/pokemon.js.coffee | 7 +++++++ 3 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 app/assets/javascripts/pokeviewer/pokemon.js create mode 100644 app/assets/javascripts/pokeviewer/pokemon.js.coffee (limited to 'app/assets/javascripts') diff --git a/app/assets/javascripts/pokeviewer/application.js b/app/assets/javascripts/pokeviewer/application.js index e54c646..52d2214 100644 --- a/app/assets/javascripts/pokeviewer/application.js +++ b/app/assets/javascripts/pokeviewer/application.js @@ -10,4 +10,5 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // +//= require jquery3 //= require_tree . diff --git a/app/assets/javascripts/pokeviewer/pokemon.js b/app/assets/javascripts/pokeviewer/pokemon.js deleted file mode 100644 index dee720f..0000000 --- a/app/assets/javascripts/pokeviewer/pokemon.js +++ /dev/null @@ -1,2 +0,0 @@ -// Place all the behaviors and hooks related to the matching controller here. -// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/pokeviewer/pokemon.js.coffee b/app/assets/javascripts/pokeviewer/pokemon.js.coffee new file mode 100644 index 0000000..f82f196 --- /dev/null +++ b/app/assets/javascripts/pokeviewer/pokemon.js.coffee @@ -0,0 +1,7 @@ +$ -> + $(".pc-pokemon").mouseover -> + $(this).children(".pc-data").show() + $(".pc-pokemon").mouseout -> + $(this).children(".pc-data").hide() + $(".pc-pokemon").mousemove (event) -> + $(this).children(".pc-data").offset({left: event.pageX + 16, top: event.pageY - 16}) -- cgit 1.4.1