WordPress.org

Make WordPress Core

Changeset 31632


Ignore:
Timestamp:
03/05/2015 09:02:42 PM (6 years ago)
Author:
wonderboymusic
Message:

In the modal state for Embed previews, only show the Title field when the preview fails.

Props johnbillion, wonderboymusic.
See #29476.

Location:
trunk/src/wp-includes/js/media
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media/views.js

    r31620 r31632  
    46364636                shortcode: embed.string()
    46374637            }
    4638         } ).done( _.bind( this.renderoEmbed, this ) );
     4638        } )
     4639            .done( _.bind( this.renderoEmbed, this ) )
     4640            .fail( _.bind( this.renderFail, this ) );
     4641    },
     4642
     4643    renderFail: function () {
     4644        this.$( '.setting' ).hide().filter( '.title' ).show();
    46394645    },
    46404646
     
    46434649            attr = {},
    46444650            opts = { silent: true };
     4651
     4652        this.$( '.setting' ).hide()
     4653            .filter( '.title' )[ html ? 'hide' : 'show' ]();
    46454654
    46464655        if ( response && response.attr ) {
     
    46654674
    46664675        this.spinner.hide();
    4667        
     4676
    46684677        this.$('.embed-container').show().find('.embed-preview').html( html );
    46694678    }
  • trunk/src/wp-includes/js/media/views/embed/link.js

    r31620 r31632  
    5959                shortcode: embed.string()
    6060            }
    61         } ).done( _.bind( this.renderoEmbed, this ) );
     61        } )
     62            .done( _.bind( this.renderoEmbed, this ) )
     63            .fail( _.bind( this.renderFail, this ) );
     64    },
     65
     66    renderFail: function () {
     67        this.$( '.setting' ).hide().filter( '.title' ).show();
    6268    },
    6369
     
    6672            attr = {},
    6773            opts = { silent: true };
     74
     75        this.$( '.setting' ).hide()
     76            .filter( '.title' )[ html ? 'hide' : 'show' ]();
    6877
    6978        if ( response && response.attr ) {
     
    8897
    8998        this.spinner.hide();
    90        
     99
    91100        this.$('.embed-container').show().find('.embed-preview').html( html );
    92101    }
Note: See TracChangeset for help on using the changeset viewer.