Ticket #27521: 27521.14.diff
File 27521.14.diff, 1.2 KB (added by , 7 years ago) |
---|
-
src/wp-admin/js/theme.js
716 716 html: themes.template( 'theme-preview' ), 717 717 718 718 render: function() { 719 var data = this.model.toJSON(); 719 var data = this.model.toJSON(), 720 self = this; 720 721 this.$el.html( this.html( data ) ); 721 722 722 723 themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } ); 723 724 724 725 this.$el.fadeIn( 200, function() { 725 $( 'body' ).addClass( 'theme-installer-active full-overlay-active' ); 726 $( 'body' ) 727 .addClass( 'theme-installer-active full-overlay-active' ) 728 .on( 'keyup', function( event ) { 729 // Pressing the escape closes the preview 730 if ( event.keyCode === 27 ) { 731 self.close(); 732 } 733 });; 726 734 $( '.close-full-overlay' ).focus(); 735 727 736 }); 728 737 }, 729 738 730 739 close: function() { 731 740 this.$el.fadeOut( 200, function() { 732 $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ) ;741 $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ).unbind( 'keyup' ); 733 742 734 743 // Return focus to the theme div 735 744 if ( themes.focusedTheme ) {