Make WordPress Core

Ticket #28581: 28581.patch

File 28581.patch, 1.6 KB (added by SergeyBiryukov, 9 years ago)
  • src/wp-admin/js/theme.js

     
    362362
    363363        events: {
    364364                'click': themes.isInstall ? 'preview': 'expand',
    365                 'click .preview': 'preview',
    366365                'keydown': themes.isInstall ? 'preview': 'expand',
    367366                'touchend': themes.isInstall ? 'preview': 'expand',
    368367                'keyup': 'addFocus',
     
    487486                        preview.$el.removeClass( 'no-navigation' );
    488487                }
    489488
    490                 // Apend preview
     489                // Append preview
    491490                $( 'div.wrap' ).append( preview.el );
    492491
    493492                // Listen to our preview object
     
    511510                                return self.current = current;
    512511                        }
    513512
    514                         // Construct a new Preview view.
    515                         preview = new themes.view.Preview({
    516                                 model: self.current
    517                         });
     513                        preview.model = self.current;
    518514
    519515                        // Render and append.
    520516                        preview.render();
    521517                        this.setNavButtonsState();
    522                         $( 'div.wrap' ).append( preview.el );
    523518                        $( '.next-theme' ).focus();
    524519                })
    525520                .listenTo( preview, 'theme:previous', function() {
     
    545540                                return;
    546541                        }
    547542
    548                         // Construct a new Preview view.
    549                         preview = new themes.view.Preview({
    550                                 model: self.current
    551                         });
     543                        preview.model = self.current;
    552544
    553545                        // Render and append.
    554546                        preview.render();
    555547                        this.setNavButtonsState();
    556                         $( 'div.wrap' ).append( preview.el );
    557548                        $( '.previous-theme' ).focus();
    558549                });
    559550
     
    786777
    787778                themes.router.navigate( themes.router.baseUrl( '' ) );
    788779                this.trigger( 'preview:close' );
     780                this.undelegateEvents();
    789781                this.unbind();
    790782                return false;
    791783        },