2010-05-25 00:32:12 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
var updateContentsOrder = function() {
|
|
|
|
var list = $('ul#contents-list.sortable');
|
|
|
|
var ids = jQuery.map(list.sortable('toArray'), function(e) {
|
|
|
|
return e.match(/content-(\w+)/)[1];
|
|
|
|
}).join(',');
|
|
|
|
$('#order').val(ids || '');
|
|
|
|
}
|
|
|
|
|
|
|
|
$('ul#contents-list.sortable').sortable({
|
2010-05-26 00:41:10 +00:00
|
|
|
handle: 'em',
|
2010-05-25 00:32:12 +00:00
|
|
|
items: 'li.content',
|
|
|
|
stop: function(event, ui) { updateContentsOrder(); }
|
|
|
|
});
|
2010-06-10 13:30:22 +00:00
|
|
|
|
|
|
|
$('button.edit-categories-link').click(function() {
|
|
|
|
var link = $(this);
|
|
|
|
$.fancybox({
|
|
|
|
titleShow: false,
|
|
|
|
href: link.attr('data-url'),
|
|
|
|
padding: 0,
|
|
|
|
onComplete: function() { SetupCustomFieldCategoryEditor(link.prev()); },
|
|
|
|
onCleanup: function() { console.log('closing...'); }
|
|
|
|
})
|
|
|
|
});
|
2010-05-25 00:32:12 +00:00
|
|
|
});
|