mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-10 18:37:58 +01:00
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:
parent
fc7a7b8972
commit
707eca46ab
@ -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
|
||||
|
2
wp-admin/js/theme.min.js
vendored
2
wp-admin/js/theme.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user