Make WordPress Core

Ticket #33322: 33322.3.patch

File 33322.3.patch, 2.5 KB (added by afercia, 10 years ago)
  • src/wp-admin/css/themes.css

     
    16341634}
    16351635
    16361636.theme-install-overlay .wp-full-overlay-main {
     1637        position: relative;
     1638        z-index: 0;
     1639        background-color: #fff;
     1640}
     1641
     1642.theme-install-overlay .wp-full-overlay-main:before {
     1643        content: '';
     1644        display: block;
     1645        width: 20px;
     1646        height: 20px;
     1647        position: absolute;
     1648        left: 50%;
     1649        top: 50%;
     1650        z-index: -1;
     1651        margin: -10px 0 0 -10px;
     1652        transform: translateZ(0);
    16371653        background: #fff url(../images/spinner.gif) no-repeat center center;
    16381654        -webkit-background-size: 20px 20px;
    16391655        background-size: 20px 20px;
    16401656}
    16411657
     1658.theme-install-overlay.iframe-ready .wp-full-overlay-main:before {
     1659        background-image: none;
     1660}
     1661
    16421662/* =Media Queries
    16431663-------------------------------------------------------------- */
    16441664
     
    16561676
    16571677        #customize-preview.wp-full-overlay-main,
    16581678        .customize-loading #customize-container,
    1659         .theme-install-overlay .wp-full-overlay-main {
     1679        .theme-install-overlay .wp-full-overlay-main:before {
    16601680                background-image: url(../images/spinner-2x.gif);
    16611681        }
    16621682}
  • src/wp-admin/js/theme.js

     
    766766        html: themes.template( 'theme-preview' ),
    767767
    768768        render: function() {
    769                 var data = this.model.toJSON();
     769                var self = this,
     770                        data = this.model.toJSON(),
     771                        $overlay = this.$el;
    770772
    771                 this.$el.html( this.html( data ) );
     773                $overlay.removeClass( 'iframe-ready' ).html( this.html( data ) );
    772774
    773775                themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ), { replace: true } );
    774776
    775                 this.$el.fadeIn( 200, function() {
     777                $overlay.fadeIn( 200, function() {
    776778                        $( 'body' ).addClass( 'theme-installer-active full-overlay-active' );
    777779                        $( '.close-full-overlay' ).focus();
    778780                });
     781
     782                $overlay.find( 'iframe' ).one( 'load', function() {
     783                        self.iframeLoaded();
     784                });
    779785        },
    780786
     787        iframeLoaded: function() {
     788                this.$el.addClass( 'iframe-ready' );
     789        },
     790
    781791        close: function() {
    782792                this.$el.fadeOut( 200, function() {
    783793                        $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' );
     
    786796                        if ( themes.focusedTheme ) {
    787797                                themes.focusedTheme.focus();
    788798                        }
    789                 });
     799                }).removeClass( 'iframe-ready' );
    790800
    791801                themes.router.navigate( themes.router.baseUrl( '' ) );
    792802                this.trigger( 'preview:close' );