Media: Add instructions to drag and drop to reorder images on gallery and batch edit pages.

Removes search boxes from these pages as well.

see #21390.


git-svn-id: http://core.svn.wordpress.org/trunk@22529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-10 09:11:33 +00:00
parent ead998c57d
commit 9c20d148b9
3 changed files with 38 additions and 14 deletions

View File

@ -277,6 +277,10 @@
font-family: sans-serif; font-family: sans-serif;
} }
.media-toolbar-secondary .search {
margin-right: 16px;
}
/** /**
* Attachments * Attachments
*/ */
@ -496,6 +500,14 @@
overflow: auto; overflow: auto;
} }
.attachments-browser .instructions {
display: inline-block;
margin-top: 16px;
line-height: 18px;
font-size: 13px;
color: #999;
}
/** /**
* Progress Bar * Progress Bar

View File

@ -263,11 +263,12 @@
// --------------------------- // ---------------------------
media.controller.Library = media.controller.State.extend({ media.controller.Library = media.controller.State.extend({
defaults: { defaults: {
id: 'library', id: 'library',
multiple: false, multiple: false,
describe: false, describe: false,
toolbar: 'main-attachments', toolbar: 'main-attachments',
sidebar: 'settings' sidebar: 'settings',
searchable: true
}, },
initialize: function() { initialize: function() {
@ -501,6 +502,7 @@
edge: 199, edge: 199,
editing: false, editing: false,
sortable: true, sortable: true,
searchable: false,
toolbar: 'gallery-edit', toolbar: 'gallery-edit',
sidebar: 'settings' sidebar: 'settings'
}, },
@ -809,6 +811,7 @@
collection: state.get('library'), collection: state.get('library'),
model: state, model: state,
sortable: state.get('sortable'), sortable: state.get('sortable'),
search: state.get('searchable'),
AttachmentView: state.get('AttachmentView') AttachmentView: state.get('AttachmentView')
}).render() ); }).render() );
@ -945,14 +948,15 @@
// Batch states. // Batch states.
new media.controller.Library({ new media.controller.Library({
id: 'batch-edit', id: 'batch-edit',
multiple: false, multiple: false,
describe: true, describe: true,
edge: 199, edge: 199,
sortable: true, sortable: true,
menu: 'batch', searchable: false,
toolbar: 'batch-edit', menu: 'batch',
sidebar: 'attachment-settings' toolbar: 'batch-edit',
sidebar: 'attachment-settings'
}), }),
new media.controller.Library( _.defaults({ new media.controller.Library( _.defaults({
@ -2316,10 +2320,17 @@
this.toolbar.add( 'search', new media.view.Search({ this.toolbar.add( 'search', new media.view.Search({
controller: this.controller, controller: this.controller,
model: this.collection.props, model: this.collection.props,
priority: -40 priority: -60
}).render() ); }).render() );
} }
if ( this.options.sortable ) {
this.toolbar.add( 'dragInfo', new Backbone.View({
el: $( '<div class="instructions">' + l10n.dragInfo + '</div>' )[0],
priority: -40
}) );
}
this.attachments = new media.view.Attachments({ this.attachments = new media.view.Attachments({
controller: this.controller, controller: this.controller,
collection: this.collection, collection: this.collection,

View File

@ -1328,6 +1328,7 @@ function wp_enqueue_media() {
'cancel' => __( 'Cancel' ), 'cancel' => __( 'Cancel' ),
'addImages' => __( 'Add images' ), 'addImages' => __( 'Add images' ),
'selected' => __( 'selected' ), 'selected' => __( 'selected' ),
'dragInfo' => __( 'Drag and drop to reorder images.' ),
// Upload // Upload
'uploadFilesTitle' => __( 'Upload Files' ), 'uploadFilesTitle' => __( 'Upload Files' ),