Make WordPress Core

Changeset 22706


Ignore:
Timestamp:
11/20/2012 11:10:04 AM (12 years ago)
Author:
koopersmith
Message:

Media: Attachment checkboxes now function as such. fixes #22462, see #21390.

Location:
trunk/wp-includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/css/media-views.css

    r22703 r22706  
    434434    box-shadow:
    435435        0 0 0 1px #fff,
    436         0 0 0 4px #777;
     436        0 0 0 3px #ccc;
    437437}
    438438
     
    440440    box-shadow:
    441441        0 0 0 1px #fff,
    442         0 0 0 4px #1e8cbe;
    443 }
    444 
    445 
    446 .attachment.library.selected:after {
    447     content: '\2713';
    448     display: block;
    449     height: 24px;
    450     width: 24px;
    451     position: absolute;
    452     top: -1px;
    453     right: -1px;
    454     line-height: 24px;
    455     font-size: 18px;
    456     text-align: center;
    457     color: #fff;
    458     text-shadow: 0 1px 0 rgba( 0, 0, 0, 0.5 );
    459     background: #777;
    460     border: 1px solid #fff;
    461     border-width: 0 0 1px 1px;
    462     box-shadow: -1px 1px 0 rgba( 0, 0, 0, 0.1 );
    463 }
    464 
    465 .attachment.library.details:after {
    466     background: #1e8cbe;
     442        0 0 0 5px #1e8cbe;
    467443}
    468444
     
    471447    width: 199px;
    472448    height: 199px;
    473     overflow: hidden;
    474449    box-shadow:
    475450        inset 0 0 15px rgba( 0, 0, 0, 0.1 ),
     
    486461    left: 0;
    487462    margin: 0 auto;
     463    overflow: hidden;
    488464}
    489465
     
    555531
    556532.attachment .close {
    557     display: none;
    558533    position: absolute;
    559534    top: 5px;
     
    572547}
    573548
    574 .attachment .close:hover {
     549.attachment .button:hover {
    575550    box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.6 );
    576551}
    577552
     553.attachment .close {
     554    display: none;
     555}
     556
    578557.attachment:hover .close {
    579558    display: block;
     559}
     560
     561.attachment .check {
     562    display: none;
     563    height: 24px;
     564    width: 24px;
     565    position: absolute;
     566    top: -7px;
     567    right: -7px;
     568    line-height: 24px;
     569    font-size: 16px;
     570    text-align: center;
     571    text-decoration: none;
     572    outline: none;
     573
     574    color: #333;
     575    border: 1px solid #fff;
     576    border-radius: 3px;
     577    text-shadow: 0 1px 0 #fff;
     578    box-shadow: 0 0 0 1px rgba( 0, 0, 0, 0.4 );
     579
     580    background: #f1f1f1;
     581    background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
     582    background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
     583    background-image:    -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
     584    background-image:      -o-linear-gradient(top, #f1f1f1, #e1e1e1);
     585    background-image:   linear-gradient(to bottom, #f1f1f1, #e1e1e1);
     586}
     587
     588.attachment .check .dash {
     589    font-weight: bold;
     590    font-size: 18px;
     591    line-height: 22px;
     592}
     593
     594.attachment .check .dash,
     595.attachment .check:hover span {
     596    display: none;
     597}
     598
     599.attachment.selected .check,
     600.attachment .check:hover .dash {
     601    display: block;
     602}
     603
     604.attachment.details .check {
     605    color: #fff;
     606    text-shadow: 0 1px 0 rgba( 0, 0, 0, 0.5 );
     607    box-shadow: 0 0 0 1px #1e8cbe;
     608
     609    background: #1e8cbe;
     610    background-image: -webkit-gradient(linear, left top, left bottom, from(#1e8cbe), to(#0074a2));
     611    background-image: -webkit-linear-gradient(top, #1e8cbe, #0074a2);
     612    background-image:    -moz-linear-gradient(top, #1e8cbe, #0074a2);
     613    background-image:      -o-linear-gradient(top, #1e8cbe, #0074a2);
     614    background-image:   linear-gradient(to bottom, #1e8cbe, #0074a2);
    580615}
    581616
     
    859894    bottom: 0;
    860895    width: 25px;
    861     background-image: -webkit-gradient(linear, right top, right top, from( rgba( 255, 255, 255, 1 ) ), to( rgba( 255, 255, 255, 0 ) ));
     896    background-image: -webkit-gradient(linear, right top, left top, from( rgba( 255, 255, 255, 1 ) ), to( rgba( 255, 255, 255, 0 ) ));
    862897    background-image: -webkit-linear-gradient(right, rgba( 255, 255, 255, 1 ) ,  rgba( 255, 255, 255, 0 ) );
    863898    background-image:    -moz-linear-gradient(right, rgba( 255, 255, 255, 1 ) ,  rgba( 255, 255, 255, 0 ) );
  • trunk/wp-includes/js/media-models.js

    r22694 r22706  
    713713            // Binds `single` instead of using the context argument to ensure
    714714            // it receives no parameters.
    715             this.on( 'add remove reset', _.bind( this.single, this ) );
     715            this.on( 'add remove reset', _.bind( this.single, this, false ) );
    716716        },
    717717
  • trunk/wp-includes/js/media-views.js

    r22694 r22706  
    23102310
    23112311        events: {
    2312             'mousedown .attachment-preview':  'toggleSelection',
     2312            'click .attachment-preview':      'toggleSelection',
    23132313            'change [data-setting]':          'updateSetting',
    23142314            'change [data-setting] input':    'updateSetting',
     
    23162316            'change [data-setting] textarea': 'updateSetting',
    23172317            'click .close':                   'removeFromLibrary',
     2318            'click .check':                   'removeFromSelection',
    23182319            'click a':                        'preventDefault'
    23192320        },
     
    23962397                selection[ selection.single() === model ? 'remove' : 'single' ]( model );
    23972398            } else {
    2398                 selection.add( model ).single();
     2399                selection.add( model ).single( model );
    23992400            }
    24002401        },
     
    24772478
    24782479            this.collection.remove( this.model );
     2480        },
     2481
     2482        removeFromSelection: function( event ) {
     2483            var selection = this.options.selection;
     2484            if ( ! selection )
     2485                return;
     2486
     2487            // Stop propagation so the model isn't selected.
     2488            event.stopPropagation();
     2489
     2490            selection.remove( this.model );
    24792491        }
    24802492    });
     
    24842496     */
    24852497    media.view.Attachment.Library = media.view.Attachment.extend({
    2486         className: 'attachment library'
     2498        buttons: {
     2499            check: true
     2500        }
    24872501    });
    24882502
  • trunk/wp-includes/media.php

    r22702 r22706  
    14531453                <a class="close button" href="#">&times;</a>
    14541454            <# } #>
     1455
     1456            <# if ( data.buttons.check ) { #>
     1457                <a class="check" href="#"><span>&#10003;</span><span class="dash">&ndash;</span></a>
     1458            <# } #>
    14551459        </div>
    14561460        <# if ( data.describe ) { #>
Note: See TracChangeset for help on using the changeset viewer.