Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added JS functionality to allow us to display our associated items wh…
…en a page has been changed. Also refactored so that the pagination works as we expect it to.
- Loading branch information
Showing
1 changed file
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
$('#list').html("<%= escape_javascript(render :partial => '/common/sortable_list',:locals => {:models => @feature_stories, :item_name => 'story', :assoc => 'step', :order =>true})%>"); | ||
$('div#lists ul').customSortable(); | ||
$('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); | ||
}); | ||
}); |