Changeset 22535
- Timestamp:
- 11/10/2012 07:25:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22533 r22535 1598 1598 media.view.Toolbar.Insert.Post = media.view.Toolbar.Insert.extend({ 1599 1599 initialize: function() { 1600 var selectionToLibrary = function( state ) {1600 var selectionToLibrary = function( state, filter ) { 1601 1601 return function() { 1602 1602 var controller = this.controller, 1603 1603 selection = controller.state().get('selection'), 1604 edit = controller.get( state ); 1605 1606 edit.set( 'library', new media.model.Selection( selection.models, { 1604 edit = controller.get( state ), 1605 models = filter ? filter( selection ) : selection.models; 1606 1607 edit.set( 'library', new media.model.Selection( models, { 1607 1608 props: selection.props.toJSON(), 1608 1609 multiple: true … … 1617 1618 text: l10n.createNewGallery, 1618 1619 priority: 40, 1619 click: selectionToLibrary('gallery-edit') 1620 click: selectionToLibrary('gallery-edit', function( selection ) { 1621 return selection.where({ type: 'image' }); 1622 }) 1620 1623 }, 1621 1624 … … 1638 1641 1639 1642 // Check if every attachment in the selection is an image. 1640 this.get('gallery').$el.toggle( count > 1 && selection.a ll( function( attachment ) {1643 this.get('gallery').$el.toggle( count > 1 && selection.any( function( attachment ) { 1641 1644 return 'image' === attachment.get('type'); 1642 1645 }) );
Note: See TracChangeset
for help on using the changeset viewer.