this.$el.html( this.html( data ) );
- themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.get( 'id' ) ), { replace: true } );
+ themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ), { replace: true } );
this.$el.fadeIn( 200, function() {
$( 'body' ).addClass( 'theme-installer-active full-overlay-active' );
index: 0,
// The theme count element
- count: $( '.theme-count' ),
+ count: $( '.wp-filter .theme-count' ),
initialize: function( options ) {
var self = this;
this.model = self.collection.get( id );
// Trigger a route update for the current model
- themes.router.navigate( themes.router.baseUrl( '?theme=' + this.model.id ) );
+ themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.id ) );
// Sets this.view to 'detail'
this.setView( 'detail' );
// Update the URL hash
if ( event.target.value ) {
- themes.router.navigate( themes.router.baseUrl( '?search=' + event.target.value ), options );
+ themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + event.target.value ), options );
} else {
themes.router.navigate( themes.router.baseUrl( '' ) );
}
var url = themes.router.baseUrl( '' );
if ( event.target.value ) {
- url = themes.router.baseUrl( '?search=' + event.target.value );
+ url = themes.router.baseUrl( themes.router.searchPath + event.target.value );
}
this.searching = false;
return 'themes.php' + url;
},
+ themePath: '?theme=',
+ searchPath: '?search=',
+
search: function( query ) {
$( '.wp-filter-search' ).val( query );
},
this.collection.query( request );
// Set route
- themes.router.navigate( themes.router.baseUrl( '?search=' + value ), { replace: true } );
+ themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + value ), { replace: true } );
}, 300 )
});
this.sort( sort );
// Trigger a router.naviagte update
- themes.router.navigate( themes.router.baseUrl( '?browse=' + sort ) );
+ themes.router.navigate( themes.router.baseUrl( themes.router.browsePath + sort ) );
},
sort: function( sort ) {
return 'theme-install.php' + url;
},
+ themePath: '?theme=',
+ browsePath: '?browse=',
+ searchPath: '?search=',
+
search: function( query ) {
$( '.wp-filter-search' ).val( query );
},
} else {
themes.Run.init();
}
+
+ $( '.broken-themes .delete-theme' ).on( 'click', function() {
+ return confirm( _wpThemeSettings.settings.confirmDelete );
+ });
});
})( jQuery );