diff --git a/app/views/admin/personal_plugin_fields/fields_setting.html.erb b/app/views/admin/personal_plugin_fields/fields_setting.html.erb index 19127dd..7d9e350 100644 --- a/app/views/admin/personal_plugin_fields/fields_setting.html.erb +++ b/app/views/admin/personal_plugin_fields/fields_setting.html.erb @@ -106,8 +106,8 @@ handle: ".brand", update: function(event, ui) { var new_index = ui.item.index(); - var old_index = ui.item.attr("index"); - var indices = [new_index,old_index].sort(); + var old_index = parseInt(ui.item.attr("index")); + var indices = [new_index,old_index].sort(function(a,b){return a - b}); for(var new_i=indices[0];new_i<=indices[1];new_i++){ var td = ui.item.parent().find(">").eq(new_i); var old_i =td.attr("index");