Sanity check $uploaderToggler in wp.media.view.UploaderInline.

This ensures `$uploaderToggler` exists before checking length so any views
extending or scripts accessing this view, won't encounter errors that stop execution.

Props Blackbam, yahil.
Fixes #41231.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill 2017-07-06 00:41:41 +00:00
parent d8c50c7a12
commit 37b500c4bd
3 changed files with 4 additions and 4 deletions

View File

@ -8228,13 +8228,13 @@ UploaderInline = View.extend({
},
show: function() {
this.$el.removeClass( 'hidden' );
if ( this.controller.$uploaderToggler.length ) {
if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) {
this.controller.$uploaderToggler.attr( 'aria-expanded', 'true' );
}
},
hide: function() {
this.$el.addClass( 'hidden' );
if ( this.controller.$uploaderToggler.length ) {
if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) {
this.controller.$uploaderToggler
.attr( 'aria-expanded', 'false' )
// Move focus back to the toggle button when closing the uploader.

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-41008';
$wp_version = '4.9-alpha-41009';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.