Use data-aspect_id, because integer html ids freak me out.
This commit is contained in:
parent
ee95def580
commit
8ce5e72519
2 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
%ul.sub_nav
|
||||
- for aspect in all_aspects
|
||||
%li{:id => aspect.id, :class => ("active" if params["a_id"].to_i == aspect.id)}
|
||||
%li{:data => {:aspect_id => aspect.id}, :class => ("active" if params["a_id"].to_i == aspect.id)}
|
||||
.edit
|
||||
= link_to image_tag("icons/pencil.svg", :height => 12), edit_aspect_path(aspect), :rel => "facebox"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
$(document).ready(function() {
|
||||
$('#aspect_nav.left_nav .all_aspects .sub_nav').sortable({
|
||||
items: 'li[id]',
|
||||
items: "li[data-aspect_id]",
|
||||
update: function(event, ui) {
|
||||
var order = $(this).sortable('toArray'),
|
||||
var order = $(this).sortable("toArray", {attribute: "data-aspect_id"}),
|
||||
obj = { 'reorder_aspects': order, '_method': 'put' };
|
||||
$.ajax('/user', { type: 'post', dataType: 'script', data: obj });
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue