mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-26 18:21:30 +01:00
Media Grid: remove Router code that doesn't actually ever run.
See #29121. Built from https://develop.svn.wordpress.org/trunk@29443 git-svn-id: http://core.svn.wordpress.org/trunk@29221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
19db9a253d
commit
1217efe905
@ -266,8 +266,7 @@
|
|||||||
media.view.MediaFrame.Manage.Router = Backbone.Router.extend({
|
media.view.MediaFrame.Manage.Router = Backbone.Router.extend({
|
||||||
routes: {
|
routes: {
|
||||||
'upload.php?item=:slug': 'showItem',
|
'upload.php?item=:slug': 'showItem',
|
||||||
'upload.php?search=:query': 'search',
|
'upload.php?search=:query': 'search'
|
||||||
':default': 'defaultRoute'
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Map routes against the page URL
|
// Map routes against the page URL
|
||||||
@ -277,8 +276,6 @@
|
|||||||
|
|
||||||
// Respond to the search route by filling the search field and trigggering the input event
|
// Respond to the search route by filling the search field and trigggering the input event
|
||||||
search: function( query ) {
|
search: function( query ) {
|
||||||
// Ensure modal closed, see back button
|
|
||||||
this.closeModal();
|
|
||||||
$( '#media-search-input' ).val( query ).trigger( 'input' );
|
$( '#media-search-input' ).val( query ).trigger( 'input' );
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -286,23 +283,8 @@
|
|||||||
showItem: function( query ) {
|
showItem: function( query ) {
|
||||||
var library = media.frame.state().get('library');
|
var library = media.frame.state().get('library');
|
||||||
|
|
||||||
// Remove existing modal if present
|
|
||||||
this.closeModal();
|
|
||||||
// Trigger the media frame to open the correct item
|
// Trigger the media frame to open the correct item
|
||||||
media.frame.trigger( 'edit:attachment', library.findWhere( { id: parseInt( query, 10 ) } ) );
|
media.frame.trigger( 'edit:attachment', library.findWhere( { id: parseInt( query, 10 ) } ) );
|
||||||
},
|
|
||||||
|
|
||||||
// Close the modal if set up
|
|
||||||
closeModal: function() {
|
|
||||||
if ( media.frame.modal ) {
|
|
||||||
media.frame.modal.close();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// Default route: make sure the modal and search are reset
|
|
||||||
defaultRoute: function() {
|
|
||||||
this.closeModal();
|
|
||||||
$( '#media-search-input' ).val( '' ).trigger( 'input' );
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -344,6 +326,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.gridRouter = this.options.gridRouter;
|
this.gridRouter = this.options.gridRouter;
|
||||||
|
|
||||||
this.library = this.options.library;
|
this.library = this.options.library;
|
||||||
|
|
||||||
if ( this.options.model ) {
|
if ( this.options.model ) {
|
||||||
|
2
wp-includes/js/media-grid.min.js
vendored
2
wp-includes/js/media-grid.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user