Commit ea836253 authored by Scott Taylor's avatar Scott Taylor
Browse files

Remove a few unnecessary jQuery selectors added in [27239]. Playlists don't...

Remove a few unnecessary jQuery selectors added in [27239]. Playlists don't exist in some older contexts that galleries do.

See #26631.


Built from https://develop.svn.wordpress.org/trunk@27243


git-svn-id: https://core.svn.wordpress.org/trunk@27100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 1d55b6e8
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ function fileQueued(fileObj) {
		.appendTo( jQuery('#media-items' ) );

	// Disable submit
	jQuery('#insert-gallery, #insert-playlist').prop('disabled', true);
	jQuery('#insert-gallery').prop('disabled', true);
}

function uploadStart() {
@@ -64,11 +64,11 @@ function updateMediaForm() {
	// Just one file, no need for collapsible part
	if ( items.length == 1 ) {
		items.addClass('open').find('.slidetoggle').show();
		jQuery('.insert-gallery, .insert-playlist').hide();
		jQuery('.insert-gallery').hide();
	} else if ( items.length > 1 ) {
		items.removeClass('open');
		// Only show Gallery/Playlist buttons when there are at least two files.
		jQuery('.insert-gallery, .insert-playlist').show();
		jQuery('.insert-gallery').show();
	}

	// Only show Save buttons when there is at least one file.
@@ -257,7 +257,7 @@ function deleteError() {
}

function uploadComplete() {
	jQuery('#insert-gallery, #insert-playlist').prop('disabled', false);
	jQuery('#insert-gallery').prop('disabled', false);
}

function switchUploader(s) {
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+5 −5
Original line number Diff line number Diff line
@@ -212,11 +212,11 @@ function updateMediaForm() {
	else
		jQuery('.savebutton').hide();

	// Only show Gallery/Playlist buttons when there are at least two files.
	// Only show Gallery buttons when there are at least two files.
	if ( items.length > 1 ) {
		jQuery('.insert-gallery, .insert-playlist').show();
		jQuery('.insert-gallery').show();
	} else {
		jQuery('.insert-gallery, .insert-playlist').hide();
		jQuery('.insert-gallery').hide();
	}
}

@@ -239,7 +239,7 @@ function uploadComplete(fileObj) {
	// If no more uploads queued, enable the submit button
	if ( swfu.getStats().files_queued == 0 ) {
		jQuery('#cancel-upload').prop('disabled', true);
		jQuery('#insert-gallery, #insert-playlist').prop('disabled', false);
		jQuery('#insert-gallery').prop('disabled', false);
	}
}