CoreFiles by mySites.guru
gallery.js20 lines, 510 bytes, from wordpress-2.6-beta1.zip
Raw History Compare with 2.3.2-beta3
md5
81518df41f8322e6068f2d0a5bf97192
sha1
565d950b03eeee4166d406f5b304e42e48e56255
sha256
e13b59c916f8a31740c9e67e5e7cb8606508b3e65112621347056fa507aac658
jQuery(function($) {
	var gallerySortable;
	var gallerySortableInit = function() {
		gallerySortable = $('#media-items').sortable( {
			items: '.media-item',
			placeholder: 'sorthelper',
			update: galleryReorder
		} );
	}

	// When an update has occurred, adjust the order for each item
	var galleryReorder = function(e, sort) {
		jQuery.each(sort['instance'].toArray(), function(i, id) {
			jQuery('#' + id + ' .menu_order input')[0].value = i;
		});
	}

	// initialize sortable
	gallerySortableInit();
});

The same content is in 2 releases, WordPress 2.6-beta1 to 2.6-beta2. See them all, or every version of this file.