Ticket #27521: 27521.15.diff
File 27521.15.diff, 1.2 KB (added by , 9 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(); 727 735 }); 728 736 }, 729 737 730 738 close: function() { 731 739 this.$el.fadeOut( 200, function() { 732 $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ) ;740 $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ).unbind( 'keyup' ); 733 741 734 742 // Return focus to the theme div 735 743 if ( themes.focusedTheme ) {