Themes: Fix the routing for Themes in a sub-directory (/wp-content/themes/prefix/theme-name/style.css) and navigate to hash-url's for searches. See #25948

Built from https://develop.svn.wordpress.org/trunk@26513


git-svn-id: http://core.svn.wordpress.org/trunk@26406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2013-12-02 00:48:09 +00:00
parent fc7a7b8972
commit 707eca46ab
2 changed files with 10 additions and 3 deletions

View File

@ -586,7 +586,14 @@ themes.view.Search = wp.Backbone.View.extend({
if ( event.type === 'keyup' && event.which === 27 ) {
event.target.value = '';
}
this.collection.doSearch( event.target.value );
// Update the URL hash
if ( event.target.value )
themes.router.navigate( 'search/' + event.target.value );
else
themes.router.navigate( '' );
}
});
@ -595,8 +602,8 @@ themes.view.Search = wp.Backbone.View.extend({
themes.routes = Backbone.Router.extend({
routes: {
'search/:query': 'search',
'theme/:slug': 'theme'
'search/*query': 'search',
'theme/*slug': 'theme'
},
// Set the search input value based on url

File diff suppressed because one or more lines are too long