Changeset 22053
- Timestamp:
- 09/27/2012 07:45:26 AM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/css/media-views.css
r22046 r22053 294 294 margin: 0 auto; 295 295 box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.4 ); 296 } 297 298 .attachment .insert { 299 display: none; 300 position: absolute; 301 left: 7px; 302 bottom: 7px; 303 } 304 305 .attachment:hover .insert { 306 display: block; 307 } 308 309 .attachment .close { 310 /*display: none;*/ 311 position: absolute; 312 top: 0; 313 right: 0; 314 height: 26px; 315 width: 26px; 316 font-size: 20px; 317 line-height: 24px; 318 text-align: center; 319 text-decoration: none; 320 color: #464646; 321 background: #fff; 322 } 323 324 .attachment:hover .close { 325 display: block; 296 326 } 297 327 -
trunk/wp-includes/js/media-views.js
r22046 r22053 379 379 }, 380 380 381 buttons: {}, 382 381 383 initialize: function() { 382 384 this.controller = this.options.controller; … … 386 388 this.model.on( 'add', this.select, this ); 387 389 this.model.on( 'remove', this.deselect, this ); 390 391 // Prevent default navigation on all links. 392 this.$el.on( 'click', 'a', this.preventDefault ); 388 393 }, 389 394 … … 395 400 orientation: attachment.orientation || 'landscape', 396 401 type: attachment.type, 397 subtype: attachment.subtype 402 subtype: attachment.subtype, 403 buttons: this.buttons 398 404 }; 399 405 … … 446 452 447 453 this.$el.removeClass('selected'); 454 }, 455 456 preventDefault: function( event ) { 457 event.preventDefault(); 448 458 } 449 459 }); … … 453 463 */ 454 464 media.view.Attachment.Library = media.view.Attachment.extend({ 455 className: 'attachment library' 465 className: 'attachment library', 466 467 buttons: { 468 insert: true 469 }, 470 471 events: _.defaults({ 472 'click .insert': 'insert' 473 }, media.view.Attachment.prototype.events ), 474 475 insert: function() { 476 this.controller.selection.reset([ this.model ]); 477 this.controller.update(); 478 } 456 479 }); 457 480 … … 460 483 */ 461 484 media.view.Attachment.Gallery = media.view.Attachment.extend({ 462 events: {} 485 buttons: { 486 close: true 487 }, 488 489 events: { 490 'click .close': 'toggleSelection' 491 } 463 492 }); 464 493 -
trunk/wp-includes/media.php
r22043 r22053 1400 1400 <div class="media-progress-bar"><div></div></div> 1401 1401 <% } %> 1402 <div class="actions"></div> 1402 1403 <% if ( buttons.close ) { %> 1404 <a class="close" href="#">×</a> 1405 <% } %> 1406 1407 <% if ( buttons.insert ) { %> 1408 <a class="insert button button-primary button-small" href="#"><?php _e( 'Insert' ); ?></a> 1409 <% } %> 1403 1410 </div> 1404 1411 <div class="describe"></div>
Note: See TracChangeset
for help on using the changeset viewer.