From 2265950262510e1d2c3ca9ae0e5d0c148f6101b4 Mon Sep 17 00:00:00 2001 From: Yomi Colledge Date: Wed, 12 May 2010 17:59:20 +0100 Subject: [PATCH] Now using our include script. --- app/views/features/show.rjs.erb | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/app/views/features/show.rjs.erb b/app/views/features/show.rjs.erb index cc591c4c..dc3eca61 100644 --- a/app/views/features/show.rjs.erb +++ b/app/views/features/show.rjs.erb @@ -1,20 +1,4 @@ $('div.list').replaceWith("<%= escape_javascript(render :partial => '/common/sortable_list',:locals => {:models => @feature_stories, :item_name => 'story', :assoc => 'step', :order =>true})%>"); $('div#lists ul').customSortable(); $('div#sidebar').html("<%= escape_javascript(render :partial => '/common/sidebar_list_content', :locals => {:models => @feature_stories, :assoc => 'steps'})%>"); - -// Ideally we should not duplicate this functionality, need to find a way to centralise it -$(document).ready(function() { - - var hoverItem = function() { - $classArray = $(this).attr('id'); - $sidebarPostfix = $('div#sidebar > ul').attr('id').split('_'); - - $hover_class = 'li#' + $classArray + '_' + $sidebarPostfix[1]; - $($hover_class).toggle(); - }; - - $("div.list_item").each(function(event) { - $(this).mouseover(hoverItem); - $(this).mouseout(hoverItem); - }); -}); \ No newline at end of file +$.include('/javascripts/item_hover.js'); \ No newline at end of file