Changeset 29686
- Timestamp:
- 09/03/2014 06:09:33 AM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/media-views.css
r29632 r29686 2512 2512 } 2513 2513 2514 . attachments[data-columns="1"] .attachment {2514 .media-frame-content[data-columns="1"] .attachment { 2515 2515 width: 100%; 2516 2516 } 2517 2517 2518 . attachments[data-columns="2"] .attachment {2518 .media-frame-content[data-columns="2"] .attachment { 2519 2519 width: 50%; 2520 2520 } 2521 2521 2522 . attachments[data-columns="3"] .attachment {2522 .media-frame-content[data-columns="3"] .attachment { 2523 2523 width: 33.3%; 2524 2524 } 2525 2525 2526 . attachments[data-columns="4"] .attachment {2526 .media-frame-content[data-columns="4"] .attachment { 2527 2527 width: 25%; 2528 2528 } 2529 2529 2530 . attachments[data-columns="5"] .attachment {2530 .media-frame-content[data-columns="5"] .attachment { 2531 2531 width: 20%; 2532 2532 } 2533 2533 2534 . attachments[data-columns="6"] .attachment {2534 .media-frame-content[data-columns="6"] .attachment { 2535 2535 width: 16.6%; 2536 2536 } 2537 2537 2538 . attachments[data-columns="7"] .attachment {2538 .media-frame-content[data-columns="7"] .attachment { 2539 2539 width: 14.2%; 2540 2540 } 2541 2541 2542 . attachments[data-columns="8"] .attachment {2542 .media-frame-content[data-columns="8"] .attachment { 2543 2543 width: 12.5%; 2544 2544 } 2545 2545 2546 . attachments[data-columns="9"] .attachment {2546 .media-frame-content[data-columns="9"] .attachment { 2547 2547 width: 11.1%; 2548 2548 } 2549 2549 2550 . attachments[data-columns="10"] .attachment {2550 .media-frame-content[data-columns="10"] .attachment { 2551 2551 width: 10%; 2552 2552 } 2553 2553 2554 . attachments[data-columns="11"] .attachment {2554 .media-frame-content[data-columns="11"] .attachment { 2555 2555 width: 9%; 2556 2556 } 2557 2557 2558 . attachments[data-columns="12"] .attachment {2558 .media-frame-content[data-columns="12"] .attachment { 2559 2559 width: 8.3%; 2560 2560 } -
trunk/src/wp-includes/js/media-views.js
r29680 r29686 5200 5200 5201 5201 this._viewsByCid = {}; 5202 this.$window = $( window ); 5203 this.resizeEvent = 'resize.media-modal-columns'; 5202 5204 5203 5205 this.collection.on( 'add', function( attachment ) { … … 5231 5233 5232 5234 if ( this.options.resize ) { 5233 $( window ).on( 'resize.media-modal-columns', this.setColumns );5235 this.on( 'ready', this.bindEvents ); 5234 5236 this.controller.on( 'open', this.setColumns ); 5235 } 5236 5237 // Call this.setColumns() after this view has been rendered in the DOM so 5238 // attachments get proper width applied. 5239 _.defer( this.setColumns, this ); 5237 5238 // Call this.setColumns() after this view has been rendered in the DOM so 5239 // attachments get proper width applied. 5240 _.defer( this.setColumns, this ); 5241 } 5242 }, 5243 5244 bindEvents: function() { 5245 this.$window.off( this.resizeEvent ).on( this.resizeEvent, _.debounce( this.setColumns, 50 ) ); 5240 5246 }, 5241 5247 … … 5250 5256 arrowEvent: function( event ) { 5251 5257 var attachments = this.$el.children( 'li' ), 5252 perRow = this. $el.data( 'columns' ),5258 perRow = this.columns, 5253 5259 index = attachments.filter( ':focus' ).index(), 5254 5260 row = ( index + 1 ) <= perRow ? 1 : Math.ceil( ( index + 1 ) / perRow ); … … 5293 5299 dispose: function() { 5294 5300 this.collection.props.off( null, null, this ); 5295 $( window ).off( 'resize.media-modal-columns' ); 5301 if ( this.options.resize ) { 5302 this.$window.off( this.resizeEvent ); 5303 } 5296 5304 5297 5305 /** … … 5309 5317 5310 5318 if ( ! prev || prev !== this.columns ) { 5311 this.$el. attr( 'data-columns', this.columns );5319 this.$el.closest( '.media-frame-content' ).attr( 'data-columns', this.columns ); 5312 5320 } 5313 5321 }
Note: See TracChangeset
for help on using the changeset viewer.