WordPress.org

Make WordPress Core

Ticket #41231: 41231.2.patch

File 41231.2.patch, 1.8 KB (added by joemcgill, 4 years ago)
  • src/wp-includes/js/media-views.js

    diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
    index 7ea9ed3cb6..29b56c66a8 100644
    UploaderInline = View.extend({ 
    82288228        },
    82298229        show: function() {
    82308230                this.$el.removeClass( 'hidden' );
    8231                 if ( this.controller.$uploaderToggler.length ) {
     8231                if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) {
    82328232                        this.controller.$uploaderToggler.attr( 'aria-expanded', 'true' );
    82338233                }
    82348234        },
    82358235        hide: function() {
    82368236                this.$el.addClass( 'hidden' );
    8237                 if ( this.controller.$uploaderToggler.length ) {
     8237                if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) {
    82388238                        this.controller.$uploaderToggler
    82398239                                .attr( 'aria-expanded', 'false' )
    82408240                                // Move focus back to the toggle button when closing the uploader.
  • src/wp-includes/js/media/views/uploader/inline.js

    diff --git src/wp-includes/js/media/views/uploader/inline.js src/wp-includes/js/media/views/uploader/inline.js
    index f6be006b6b..dfb208f851 100644
    UploaderInline = View.extend({ 
    119119        },
    120120        show: function() {
    121121                this.$el.removeClass( 'hidden' );
    122                 if ( this.controller.$uploaderToggler.length ) {
     122                if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) {
    123123                        this.controller.$uploaderToggler.attr( 'aria-expanded', 'true' );
    124124                }
    125125        },
    126126        hide: function() {
    127127                this.$el.addClass( 'hidden' );
    128                 if ( this.controller.$uploaderToggler.length ) {
     128                if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) {
    129129                        this.controller.$uploaderToggler
    130130                                .attr( 'aria-expanded', 'false' )
    131131                                // Move focus back to the toggle button when closing the uploader.