Skip to:
Content

BuddyPress.org

Changeset 8642


Ignore:
Timestamp:
07/17/2014 07:19:23 PM (11 years ago)
Author:
johnjamesjacoby
Message:

UI improvements to admin area XProfile field options, bringing them inline with WordPress core UI sortable elements.

Location:
trunk/src/bp-xprofile/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/admin/css/admin-rtl.css

    r8639 r8642  
    7777    }
    7878
     79    .bp-option a.delete,
    7980    .field-wrapper a.deletion,
    8081    .tab-toolbar a.deletion {
    8182        color: #f00;
    8283        border-bottom: 1px solid #f00;
    83         font-size: 12px;
    8484        text-decoration: none;
    8585        padding: 0;
    86         margin: -2px 5px 0 0;
    87     }
    88 
    89     div.actions div.delete-button {
     86    }
     87
     88    div.delete-button {
    9089        float: right;
    9190        line-height: 28px;
    92     }
    93 
    94     div.tab-toolbar a.button-primary {
    95         color: #fff !important; /* Overriding a WP !important */
     91        margin: 0 10px 0 0;
    9692    }
    9793
     
    106102    .tab-wrapper fieldset {
    107103        position: relative;
    108         cursor: default !important;
    109         }
     104        cursor: default;
     105    }
    110106        .tab-wrapper fieldset legend {
    111107            font-weight: bold;
     
    118114        border: 1px solid #ddd;
    119115        margin: 10px 0;
    120         cursor: move !important;
     116        cursor: move;
    121117        background: #fafafa;
    122118        padding: 10px 0 0 ;
     
    156152        display: block;
    157153    }
     154    .bp-options-box .ui-sortable-placeholder,
    158155    .field-group fieldset.ui-sortable-placeholder {
    159156        border: 1px dashed #999;
     
    192189        font-size: 11px;
    193190        color: #555;
    194     }
    195 
    196     select.multi-select {
    197         width:90%;
    198         height:10em !important;
    199191    }
    200192
     
    214206}
    215207
    216 div.options-box {
    217     margin-right: 20px !important;
    218     margin-left: 10px !important;
    219     border-right: 4px solid #EAF3FA;
    220     padding-right: 15px;
     208p.bp-option {
     209    background: #fafafa;
     210    border: 1px solid #dfdfdf;
     211    margin: 10px 0;
     212    padding: 10px 5px;
     213}
     214
     215p.bp-option:hover {
     216    border: 1px solid #999;
     217}
     218
     219.bp-option-icon {
     220    font: normal 20px/1 'dashicons';
     221    speak: none;
     222    display: inline-block;
     223    padding: 0 2px 0 0;
     224    top: 5px;
     225    position: relative;
     226    vertical-align: top;
     227    -webkit-font-smoothing: antialiased;
     228    -moz-osx-font-smoothing: grayscale;
     229    text-decoration: none !important;
     230    color: #888;
     231}
     232
     233p.bp-option .grabber:before {
     234    content: "\f329";
    221235}
    222236
  • trunk/src/bp-xprofile/admin/css/admin.css

    r8639 r8642  
    7777    }
    7878
     79    .bp-option a.delete,
    7980    .field-wrapper a.deletion,
    8081    .tab-toolbar a.deletion {
    8182        color: #f00;
    8283        border-bottom: 1px solid #f00;
    83         font-size: 12px;
    8484        text-decoration: none;
    8585        padding: 0;
    86         margin: -2px 0 0 5px;
    87     }
    88 
    89     div.actions div.delete-button {
     86    }
     87
     88    div.delete-button {
    9089        float: right;
    9190        line-height: 28px;
    92     }
    93 
    94     div.tab-toolbar a.button-primary {
    95         color: #fff !important; /* Overriding a WP !important */
     91        margin: 0 10px 0 0;
    9692    }
    9793
     
    106102    .tab-wrapper fieldset {
    107103        position: relative;
    108         cursor: default !important;
    109         }
     104        cursor: default;
     105    }
    110106        .tab-wrapper fieldset legend {
    111107            font-weight: bold;
     
    118114        border: 1px solid #ddd;
    119115        margin: 10px 0;
    120         cursor: move !important;
     116        cursor: move;
    121117        background: #fafafa;
    122118        padding: 10px 0 0 ;
     
    156152        display: block;
    157153    }
     154    .bp-options-box .ui-sortable-placeholder,
    158155    .field-group fieldset.ui-sortable-placeholder {
    159156        border: 1px dashed #999;
     
    192189        font-size: 11px;
    193190        color: #555;
    194     }
    195 
    196     select.multi-select {
    197         width:90%;
    198         height:10em !important;
    199191    }
    200192
     
    214206}
    215207
    216 div.options-box {
    217     margin-left: 20px !important;
    218     margin-right: 10px !important;
    219     border-left: 4px solid #EAF3FA;
    220     padding-left: 15px;
     208p.bp-option {
     209    background: #fafafa;
     210    border: 1px solid #dfdfdf;
     211    margin: 10px 0;
     212    padding: 10px 5px;
     213}
     214
     215p.bp-option:hover {
     216    border: 1px solid #999;
     217}
     218
     219.bp-option-icon {
     220    font: normal 20px/1 'dashicons';
     221    speak: none;
     222    display: inline-block;
     223    padding: 0 0 0 2px;
     224    top: 5px;
     225    position: relative;
     226    vertical-align: top;
     227    -webkit-font-smoothing: antialiased;
     228    -moz-osx-font-smoothing: grayscale;
     229    text-decoration: none !important;
     230    color: #888;
     231}
     232
     233p.bp-option .grabber:before {
     234    content: "\f329";
    221235}
    222236
  • trunk/src/bp-xprofile/admin/js/admin.js

    r8640 r8642  
    1212        theId        = document.getElementById(forWhat + '_option_number').value,
    1313        newDiv       = document.createElement('p'),
    14         newOption    = document.createElement('input'),
    15         span         = document.createElement( 'span' ),
    16         txt          = document.createTextNode( '\u00A0\u039E\u00A0' ),
     14        grabber      = document.createElement( 'span' ),
     15        newOption    = document.createElement( 'input' ),
     16        label        = document.createElement( 'label' ),
    1717        isDefault    = document.createElement( 'input' ),
    18         span1        = document.createElement( 'span' ),
    19         txt1         = document.createTextNode( ' Default Value ' ),
    20 
    21         toDelete     = document.createElement( 'a' ),
    22         toDeleteText = document.createTextNode( '[x]' );
     18        txt1         = document.createTextNode( 'Default Value' ),
     19        toDeleteText = document.createTextNode( 'Delete' ),
     20        toDeleteWrap = document.createElement( 'div' );
     21        toDelete     = document.createElement( 'a' );
    2322
    2423    newDiv.setAttribute('id', forWhat + '_div' + theId);
    25     newDiv.setAttribute('class', 'sortable');
     24    newDiv.setAttribute('class', 'bp-option sortable');
     25
     26    grabber.setAttribute( 'class', 'bp-option-icon grabber');
    2627
    2728    newOption.setAttribute( 'type', 'text' );
    2829    newOption.setAttribute( 'name', forWhat + '_option[' + theId + ']' );
    2930    newOption.setAttribute( 'id', forWhat + '_option' + theId );
    30 
    31     span.appendChild( txt );
    3231
    3332    if ( forWhat === 'checkbox' || forWhat === 'multiselectbox' ) {
     
    4140    isDefault.setAttribute( 'value', theId );
    4241
    43     span1.appendChild( txt1 );
    44 
    4542    toDelete.setAttribute( 'href', 'javascript:hide("' + forWhat + '_div' + theId + '")' );
    4643    toDelete.setAttribute( 'class', 'delete' );
    4744    toDelete.appendChild( toDeleteText );
    4845
    49     newDiv.appendChild( span );
     46    toDeleteWrap.setAttribute( 'class', 'delete-button' );
     47    toDeleteWrap.appendChild( toDelete );
     48
     49    label.appendChild( document.createTextNode( ' ' ) );
     50    label.appendChild( isDefault );
     51    label.appendChild( document.createTextNode( ' ' ) );
     52    label.appendChild( txt1 );
     53    label.appendChild( document.createTextNode( ' ' ) );
     54
     55    newDiv.appendChild( grabber );
     56    newDiv.appendChild( document.createTextNode( ' ' ) );
    5057    newDiv.appendChild( newOption );
    51     newDiv.appendChild( document.createTextNode( ' ' ) );
    52     newDiv.appendChild( isDefault );
    53     newDiv.appendChild( span1 );
    54     newDiv.appendChild( toDelete );
     58    newDiv.appendChild( label );
     59    newDiv.appendChild( toDeleteWrap );
    5560    holder.appendChild( newDiv );
    5661
     
    100105
    101106function enableSortableFieldOptions( forWhat ) {
    102     if ( jQuery( '#' + forWhat + ' p.sortable' ).length > 1 ) {
    103         jQuery( '.bp-options-box' ).sortable( {
    104             items: 'p.sortable',
    105             tolerance: 'pointer',
    106             axis: 'y',
    107             handle: 'span'
    108         });
    109 
    110         jQuery( '.sortable span' ).css( 'cursor', 'move' );
    111     }
     107    jQuery( '.bp-options-box' ).sortable( {
     108        cursor: 'move',
     109        items: 'p.sortable',
     110        tolerance: 'intersect',
     111        axis: 'y'
     112    });
     113
     114    jQuery( '.sortable, .sortable span' ).css( 'cursor', 'move' );
    112115}
    113116
    114117function destroySortableFieldOptions() {
    115118    jQuery( '.bp-options-box' ).sortable( 'destroy' );
    116     jQuery( '.sortable span' ).css( 'cursor', 'default' );
     119    jQuery( '.sortable, .sortable span' ).css( 'cursor', 'default' );
    117120}
    118121
Note: See TracChangeset for help on using the changeset viewer.