Changeset 22356
- Timestamp:
- 11/02/2012 01:20:01 AM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22348 r22356 302 302 }).render() ); 303 303 } 304 }); 305 306 media.controller.GalleryAddImages = media.controller.Library.extend({ 307 defaults: { 308 id: 'gallery:add', 309 multiple: true, 310 title: l10n.createGalleryTitle 311 }, 312 313 initialize: function() { 314 if ( ! this.get('library') ) 315 this.set( 'library', media.query({ type: 'image' }) ); 316 return media.controller.Library.prototype.initialize.apply( this, arguments ); 317 }, 318 319 toolbar: function() { 320 var frame = this.frame; 321 322 frame.toolbar( new media.view.Toolbar.GalleryAddImages({ 323 controller: frame, 324 state: this 325 }) ); 326 }, 327 328 // Leave the sidebar. 329 sidebar: function() {} 304 330 }); 305 331 … … 384 410 library: options.selection, 385 411 editing: options.editing 386 }) 412 }), 413 new media.controller.GalleryAddImages() 387 414 ]); 388 415 … … 835 862 controller.close(); 836 863 state.trigger( 'update', library ); 837 library.clear();864 controller.get('library').get('selection').clear(); 838 865 controller.state('library'); 866 } 867 }, 868 869 addImages: { 870 text: l10n.addImages, 871 priority: -40, 872 873 click: function() { 874 controller.get('gallery:add').set( 'selection', new media.model.Selection( library.models, { 875 props: library.props.toJSON(), 876 multiple: true 877 }) ); 878 controller.state('gallery:add'); 839 879 } 840 880 }, … … 849 889 else 850 890 controller.state('library'); 891 } 892 } 893 }; 894 895 media.view.Toolbar.prototype.initialize.apply( this, arguments ); 896 } 897 }); 898 899 // wp.media.view.Toolbar.GalleryAddImages 900 // ----------------------------- 901 media.view.Toolbar.GalleryAddImages = media.view.Toolbar.extend({ 902 initialize: function() { 903 var state = this.options.state, 904 editing = state.get('editing'), 905 library = state.get('library'), 906 controller = this.options.controller; 907 908 this.options.items = { 909 update: { 910 style: 'primary', 911 text: l10n.continueEditing, 912 priority: 40, 913 914 click: function() { 915 controller.get('gallery').set( 'library', state.get('selection') ); 916 controller.state('gallery'); 917 } 918 }, 919 920 cancel: { 921 text: l10n.cancel, 922 priority: -60, 923 924 click: function() { 925 controller.state('gallery'); 851 926 } 852 927 } -
trunk/wp-includes/script-loader.php
r22348 r22356 339 339 'insertGallery' => __( 'Insert gallery' ), 340 340 'updateGallery' => __( 'Update gallery' ), 341 'continueEditing' => __( 'Continue editing' ), 341 342 ) ); 342 343
Note: See TracChangeset
for help on using the changeset viewer.