3 var gallerySortableInit = function() {
4 gallerySortable = $('#media-items').sortable( {
6 placeholder: 'sorthelper',
13 // When an update has occurred, adjust the order for each item
14 var galleryReorder = function(e, sort) {
15 jQuery.each(sort['element'].sortable('toArray'), function(i, id) {
16 jQuery('#' + id + ' .menu_order input')[0].value = (1+i);
20 // initialize sortable
21 gallerySortableInit();
24 jQuery(document).ready(function($){
25 $('.menu_order_input').each(function(){
26 if ( this.value == '0' ) this.value = '';