Make WordPress Core

Changeset 36295


Ignore:
Timestamp:
01/14/2016 04:12:16 AM (9 years ago)
Author:
johnbillion
Message:

Administration: Add a "Drag boxes here" message to empty dashboard meta boxes so it's clear to users that it's possible to drag meta boxes into empty spaces.

Props xavortm
Fixes #26399

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r36223 r36295  
    18441844    border: 3px dashed #b4b9be;
    18451845    height: 250px;
     1846    position: relative;
     1847}
     1848
     1849.metabox-holder .postbox-container .empty-container:after {
     1850    content: attr(data-emptystring);
     1851    margin: auto;
     1852    position: absolute;
     1853    top: 0;
     1854    left: 0;
     1855    bottom: 0;
     1856    right: 0;
     1857    height: 1em;
     1858    width: 200px;
     1859    text-align: center;
     1860    color: #ccc;
     1861    font-size:18px;
     1862    display: none;
    18461863}
    18471864
  • trunk/src/wp-admin/css/dashboard.css

    r36172 r36295  
    992992    }
    993993
     994    #dashboard-widgets #postbox-container-3 .empty-container:after,
     995    #dashboard-widgets #postbox-container-4 .empty-container:after {
     996        display: none;
     997    }
     998
    994999    #wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container {
    9951000        width: 100%;
     
    10121017        display: none;
    10131018    }
     1019
     1020    .metabox-holder .postbox-container .empty-container:after {
     1021        display: block;
     1022    }
    10141023}
    10151024
     
    10331042        height: 0;
    10341043        min-height: 0;
     1044    }
     1045
     1046    #dashboard-widgets #postbox-container-4 .empty-container:after {
     1047        display: none;
     1048    }
     1049
     1050    .metabox-holder .postbox-container .empty-container:after {
     1051        display: block;
    10351052    }
    10361053}
  • trunk/src/wp-admin/js/postbox.js

    r36137 r36295  
    198198                var t = $(this);
    199199
    200                 if ( visible == 1 || t.children('.postbox:visible').length )
     200                if ( visible == 1 || t.children('.postbox:visible').length ) {
    201201                    t.removeClass('empty-container');
    202                 else
     202                }
     203                else {
    203204                    t.addClass('empty-container');
     205                    t.attr('data-emptyString', postBoxL10n.postBoxEmptyString);
     206                }
    204207            });
    205208
  • trunk/src/wp-includes/script-loader.php

    r36285 r36295  
    496496
    497497        $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 );
     498        did_action( 'init' ) && $scripts->localize( 'postbox', 'postBoxL10n', array(
     499            'postBoxEmptyString' => __( 'Drag boxes here' ),
     500        ) );
    498501
    499502        $scripts->add( 'tags-box', "/wp-admin/js/tags-box$suffix.js", array( 'jquery', 'suggest' ), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.