diff --git src/wp-admin/js/theme.js src/wp-admin/js/theme.js
index 39ed26a..4c7f68d 100644
|
|
themes.view.Theme = wp.Backbone.View.extend({ |
491 | 491 | // Set focus to current theme. |
492 | 492 | themes.focusedTheme = this.$el; |
493 | 493 | |
494 | | // Construct a new Preview view. |
495 | | themes.currentPreview = preview = new themes.view.Preview({ |
| 494 | |
| 495 | themes.preview = preview = new themes.view.Preview({ |
496 | 496 | model: this.model |
497 | 497 | }); |
498 | 498 | |
… |
… |
themes.view.Theme = wp.Backbone.View.extend({ |
573 | 573 | self.current = self.model; |
574 | 574 | }); |
575 | 575 | |
576 | | // Listen for closepreview events, closing the preview. |
577 | | this.listenTo( preview, 'closepreview', function() { |
578 | | preview.close(); |
579 | | }); |
580 | 576 | }, |
581 | 577 | |
582 | 578 | // Handles .disabled classes for previous/next buttons in theme installer preview |
… |
… |
themes.view.Preview = themes.view.Details.extend({ |
907 | 903 | }, |
908 | 904 | |
909 | 905 | close: function() { |
| 906 | |
910 | 907 | this.$el.fadeOut( 200, function() { |
911 | 908 | $( 'body' ).removeClass( 'theme-installer-active full-overlay-active' ); |
912 | 909 | |
… |
… |
themes.RunInstaller = { |
1914 | 1911 | // Queries the API for the passed theme slug |
1915 | 1912 | themes.router.on( 'route:preview', function( slug ) { |
1916 | 1913 | |
| 1914 | // Construct a new Preview view. |
| 1915 | if ( themes.preview ) { |
| 1916 | themes.preview.undelegateEvents(); |
| 1917 | themes.preview.unbind(); |
| 1918 | } |
| 1919 | |
1917 | 1920 | // If the theme preview is active, set the current theme. |
1918 | 1921 | if ( self.view.view.theme && self.view.view.theme.preview ) { |
1919 | 1922 | self.view.view.theme.model = self.view.collection.findWhere( { 'slug': slug } ); |
… |
… |
themes.RunInstaller = { |
1943 | 1946 | self.view.sort( sort ); |
1944 | 1947 | |
1945 | 1948 | // Close the preview if open. |
1946 | | if ( themes.currentPreview ) { |
1947 | | themes.currentPreview.trigger( 'closepreview' ); |
| 1949 | if ( themes.preview ) { |
| 1950 | themes.preview.close(); |
1948 | 1951 | } |
1949 | 1952 | }); |
1950 | 1953 | |