Commit 3df891e8 authored by fred's avatar fred
Browse files

remove unnecessary js

parent 6dbd21a2
function gallery(element) {
var element_id = '#' + $(element).attr('id');
$(element).sortable({
items: '> li',
containment: 'parent',
placeholder: 'empty-image',
update: function(event, ui) {
var new_order = $(element).find('> li').map(function() { return $(this).data('object-id'); }).get().join();
$.ajax({
url: $(element).data('order-url'),
data: {'new-order': new_order},
success: function(data, status) {
$(element).replaceWith($(data).find(element_id));
gallery($(element_id));
}
});
}
});
$('.image-delete').on('click', function() {
$.ajax({
url: $(this).attr('href'),
success: function(data, status) {
$(element).replaceWith($(data).find(element_id));
gallery($(element_id));
}
});
return false;
});
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment