From 46dd830f8d555eb578ae978aaaff3d39dcad1c0e Mon Sep 17 00:00:00 2001 From: Terrell Miller Date: Sun, 27 Jan 2013 14:22:18 -0600 Subject: [PATCH] Adding jQuery 1.9 compatibility --- .../event_calendar/templates/jq_javascript.js | 18 +++++++++--------- .../event_calendar/templates/jq_javascript.js | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/generators/event_calendar/templates/jq_javascript.js b/generators/event_calendar/templates/jq_javascript.js index 8496fa2..2864824 100644 --- a/generators/event_calendar/templates/jq_javascript.js +++ b/generators/event_calendar/templates/jq_javascript.js @@ -4,29 +4,29 @@ */ jQuery(document).ready(function($) { var highlight_color = "#2EAC6A"; - + // highlight events that have a background color - $(".ec-event-bg").live("mouseover", function() { + $(document).on('mouseover', '.ec-event-bg', function(){ event_id = $(this).attr("data-event-id"); - event_class_name = $(this).attr("data-event-class"); + event_class_name = $(this).attr("data-event-class"); $("#ec-"+event_class_name+"-"+event_id).css("background-color", highlight_color); }); - $(".ec-event-bg").live("mouseout", function() { + $(document).on('mouseout', '.ec-event-bg', function(){ event_id = $(this).attr("data-event-id"); - event_class_name = $(this).attr("data-event-class"); + event_class_name = $(this).attr("data-event-class"); event_color = $(this).attr("data-color"); $("#ec-"+event_class_name+"-"+event_id).css("background-color", event_color); }); - + // highlight events that don't have a background color - $(".ec-event-no-bg").live("mouseover", function() { + $(document).on('mouseover', '.ec-event-no-bg', function(){ ele = $(this); ele.css("color", "white"); ele.find("a").css("color", "white"); ele.find(".ec-bullet").css("background-color", "white"); ele.css("background-color", highlight_color); }); - $(".ec-event-no-bg").live("mouseout", function() { + $(document).on('mouseout', '.ec-event-no-bg', function(){ ele = $(this); event_color = $(this).attr("data-color"); ele.css("color", event_color); @@ -34,4 +34,4 @@ jQuery(document).ready(function($) { ele.find(".ec-bullet").css("background-color", event_color); ele.css("background-color", "transparent"); }); -}); \ No newline at end of file +}); diff --git a/lib/generators/event_calendar/templates/jq_javascript.js b/lib/generators/event_calendar/templates/jq_javascript.js index 8496fa2..2864824 100644 --- a/lib/generators/event_calendar/templates/jq_javascript.js +++ b/lib/generators/event_calendar/templates/jq_javascript.js @@ -4,29 +4,29 @@ */ jQuery(document).ready(function($) { var highlight_color = "#2EAC6A"; - + // highlight events that have a background color - $(".ec-event-bg").live("mouseover", function() { + $(document).on('mouseover', '.ec-event-bg', function(){ event_id = $(this).attr("data-event-id"); - event_class_name = $(this).attr("data-event-class"); + event_class_name = $(this).attr("data-event-class"); $("#ec-"+event_class_name+"-"+event_id).css("background-color", highlight_color); }); - $(".ec-event-bg").live("mouseout", function() { + $(document).on('mouseout', '.ec-event-bg', function(){ event_id = $(this).attr("data-event-id"); - event_class_name = $(this).attr("data-event-class"); + event_class_name = $(this).attr("data-event-class"); event_color = $(this).attr("data-color"); $("#ec-"+event_class_name+"-"+event_id).css("background-color", event_color); }); - + // highlight events that don't have a background color - $(".ec-event-no-bg").live("mouseover", function() { + $(document).on('mouseover', '.ec-event-no-bg', function(){ ele = $(this); ele.css("color", "white"); ele.find("a").css("color", "white"); ele.find(".ec-bullet").css("background-color", "white"); ele.css("background-color", highlight_color); }); - $(".ec-event-no-bg").live("mouseout", function() { + $(document).on('mouseout', '.ec-event-no-bg', function(){ ele = $(this); event_color = $(this).attr("data-color"); ele.css("color", event_color); @@ -34,4 +34,4 @@ jQuery(document).ready(function($) { ele.find(".ec-bullet").css("background-color", event_color); ele.css("background-color", "transparent"); }); -}); \ No newline at end of file +});