Archived
Put nestedSortable in page_edit.js.erb
This commit is contained in:
1 parent
ef49df448d
commit
803253ebcf
2 files changed
+21
-24
No files matched your search
@@ -32,3 +32,24 @@ $('.part_kind').live('click', function() {
|
||||
$('.part_kind_partial').hide();
|
||||
$('#part_' + $(this).attr('value')).show();
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('ol.sortable').nestedSortable({
|
||||
disableNesting: 'no-nest',
|
||||
forcePlaceholderSize: true,
|
||||
handle: 'i',
|
||||
helper: 'clone',
|
||||
items: 'li',
|
||||
maxLevels: 3,
|
||||
opacity: .5,
|
||||
placeholder: 'placeholder',
|
||||
revert: 250,
|
||||
tabSize: 25,
|
||||
tolerance: 'pointer',
|
||||
toleranceElement: '> div',
|
||||
|
||||
stop: function(event, ui) {
|
||||
$.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: ui.item.parent().closest('li').attr('id'), position: ui.item.index() } );
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user