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. git-svn-id: https://develop.svn.wordpress.org/trunk@41009 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a828890ce2
commit
3eb767b5c3
|
@ -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.
|
||||
|
|
|
@ -119,13 +119,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.
|
||||
|
|
Loading…
Reference in New Issue