Changeset 1282
- Timestamp:
- 02/19/2015 08:01:44 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
r1279 r1282 280 280 // for `theme:next` and `theme:previous` events. 281 281 this.listenTo( preview, 'theme:next', function() { 282 this.trigger( 'theme:next' ); 282 283 283 284 // Keep local track of current theme model. … … 306 307 }) 307 308 .listenTo( preview, 'theme:previous', function() { 309 this.trigger( 'theme:previous' ); 308 310 309 311 // Keep track of current theme model. … … 442 444 _.extend( wp.themes.view.Preview.prototype, { 443 445 446 render: function() { 447 var data = this.model.toJSON(); 448 449 this.$el.html( this.html( data ) ); 450 451 wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.themePath + this.model.get( 'id' ) + '/preview' ) ); 452 453 this.$el.fadeIn( 200, function() { 454 $( 'body' ).addClass( 'theme-installer-active full-overlay-active' ); 455 $( '.close-full-overlay' ).focus(); 456 }); 457 }, 458 444 459 close: function() { 445 460 this.$el.fadeOut( 200, function() { … … 455 470 this.undelegateEvents(); 456 471 this.unbind(); 472 wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.themePath + this.model.get( 'id' ) ) ); 457 473 return false; 458 474 }, … … 521 537 _.extend( wp.themes.InstallerRouter.prototype, { 522 538 routes: { 523 'browse/:sort/' : 'sort',524 'tag/:tag/' : 'tag',525 'search/:query/' : 'search',539 'browse/:sort/' : 'sort', 540 'tag/:tag/' : 'tag', 541 'search/:query/' : 'search', 526 542 'author/:author/': 'author', 527 ':slug/': 'preview', 528 '': 'sort' 543 ':slug/preview/' : 'preview', 544 ':slug/' : 'preview', 545 '' : 'sort' 529 546 }, 530 547 … … 548 565 // Open the modal when matching the route for a single themes. 549 566 wp.themes.router.on( 'route:preview', function( slug ) { 567 $( '.close-full-overlay' ).trigger( 'click' ); 550 568 this.listenToOnce( self.view.collection, 'query:success', function() { 551 569 self.view.view.expand( slug );
Note: See TracChangeset
for help on using the changeset viewer.