Changeset 22508
- Timestamp:
- 11/09/2012 12:37:21 PM (12 years ago)
- Location:
- trunk/wp-includes/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/mce-view.js
r22507 r22508 601 601 var shortcodeString = shortcode.string(), 602 602 result = galleries[ shortcodeString ], 603 attrs, args, query ;603 attrs, args, query, others; 604 604 605 605 delete galleries[ shortcodeString ]; … … 628 628 args.parent = attrs.id || parent; 629 629 630 // Collect the attributes that were not included in `args`. 631 others = {}; 632 _.filter( attrs, function( value, key ) { 633 if ( _.isUndefined( args[ key ] ) ) 634 others[ key ] = value; 635 }); 636 630 637 query = media.query( args ); 631 query. props.set( _.pick( attrs, 'columns', 'link' ));638 query.gallery = new Backbone.Model( others ); 632 639 return query; 633 640 }, … … 635 642 shortcode: function( attachments ) { 636 643 var props = attachments.props.toJSON(), 637 attrs = _.pick( props, 'include', 'exclude', 'orderby', 'order', 'link', 'columns' ), 638 shortcode; 644 attrs = _.pick( props, 'include', 'exclude', 'orderby', 'order' ), 645 shortcode, clone; 646 647 if ( attachments.gallery ) 648 _.extend( attrs, attachments.gallery.toJSON() ); 639 649 640 650 attrs.ids = attachments.pluck('id'); … … 652 662 653 663 // Use a cloned version of the gallery. 654 galleries[ shortcode.string() ]= new wp.media.model.Attachments( attachments.models, {664 clone = new wp.media.model.Attachments( attachments.models, { 655 665 props: props 656 666 }); 667 clone.gallery = attachments.gallery; 668 galleries[ shortcode.string() ] = clone; 657 669 658 670 return shortcode; … … 706 718 707 719 edit: function() { 720 var selection; 721 708 722 if ( ! wp.media.view || this.frame ) 709 723 return; 724 725 selection = new wp.media.model.Selection( this.attachments.models, { 726 props: this.attachments.props.toJSON(), 727 multiple: true 728 }); 729 selection.gallery = this.attachments.gallery; 710 730 711 731 this.frame = wp.media({ … … 715 735 editing: true, 716 736 multiple: true, 717 selection: new wp.media.model.Selection( this.attachments.models, { 718 props: this.attachments.props.toJSON(), 719 multiple: true 720 }) 737 selection: selection 721 738 }); 722 739 -
trunk/wp-includes/js/media-views.js
r22506 r22508 1032 1032 // Sidebars 1033 1033 onSidebarGallerySettings: function( options ) { 1034 var library = this.state().get('library'); 1035 1036 library.gallery = library.gallery || new Backbone.Model(); 1037 1034 1038 this.sidebar.view().add({ 1035 1039 gallery: new media.view.Settings.Gallery({ 1036 1040 controller: this, 1037 model: this.state().get('library').props,1041 model: library.gallery, 1038 1042 priority: 40 1039 1043 }).render()
Note: See TracChangeset
for help on using the changeset viewer.