Dashboard columns:
* Improve responsive breakpoints for. * Remove obsolete network admin option. * Remove unnecessary JS. props SergeyBiryukov, kraftbj, lessbloat. fixes #26074. git-svn-id: https://develop.svn.wordpress.org/trunk@26392 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
90b6c4006a
commit
88bd8b4d87
@ -2440,7 +2440,7 @@ html.wp-toolbar {
|
||||
}
|
||||
|
||||
/* two columns on the dash, but keep the setting if one is selected */
|
||||
@media only screen and (min-width: 800px) and (max-width: 1399px) {
|
||||
@media only screen and (min-width: 800px) and (max-width: 1499px) {
|
||||
#wpbody-content #dashboard-widgets .postbox-container {
|
||||
width: 49.5%;
|
||||
}
|
||||
@ -2482,7 +2482,7 @@ html.wp-toolbar {
|
||||
}
|
||||
|
||||
/* three columns on the dash */
|
||||
@media only screen and (min-width: 1400px) and (max-width: 1800px) {
|
||||
@media only screen and (min-width: 1500px) and (max-width: 1800px) {
|
||||
#wpbody-content #dashboard-widgets .postbox-container {
|
||||
width: 33.5%;
|
||||
}
|
||||
|
@ -135,10 +135,9 @@ function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
|
||||
*/
|
||||
function wp_dashboard() {
|
||||
$screen = get_current_screen();
|
||||
$class = 'columns-' . get_current_screen()->get_columns();
|
||||
|
||||
?>
|
||||
<div id="dashboard-widgets" class="metabox-holder <?php echo $class; ?>">
|
||||
<div id="dashboard-widgets" class="metabox-holder">
|
||||
<div id='postbox-container-1' class='postbox-container'>
|
||||
<?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
|
||||
</div>
|
||||
|
@ -6,8 +6,7 @@ jQuery(document).ready( function($) {
|
||||
welcomePanel = $( '#welcome-panel' ),
|
||||
welcomePanelHide = $('#wp_welcome_panel-hide'),
|
||||
updateWelcomePanel,
|
||||
metaboxHolder = $( '.metabox-holder' ),
|
||||
updateColumnCount;
|
||||
metaboxHolder = $( '.metabox-holder' );
|
||||
|
||||
updateWelcomePanel = function( visible ) {
|
||||
$.post( ajaxurl, {
|
||||
@ -132,30 +131,4 @@ jQuery(document).ready( function($) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
updateColumnCount = function( $window, $holder ) {
|
||||
var cols = 1,
|
||||
windowWidth = parseInt( $window.width(), 10 );
|
||||
|
||||
if (799 < windowWidth && 1299 > windowWidth) {
|
||||
cols = 2;
|
||||
}
|
||||
|
||||
if (1300 < windowWidth && 1799 > windowWidth) {
|
||||
cols = 3;
|
||||
}
|
||||
|
||||
if (1800 < windowWidth) {
|
||||
cols = 4;
|
||||
}
|
||||
|
||||
$holder.attr( 'class', $holder.attr( 'class' ).replace( /columns-\d+/, 'columns-' + cols ) );
|
||||
};
|
||||
|
||||
// Update main column count on load
|
||||
updateColumnCount( $window, metaboxHolder );
|
||||
|
||||
$window.on( 'resize', _.debounce(function() {
|
||||
updateColumnCount( $window, metaboxHolder );
|
||||
}, 30 ) );
|
||||
|
||||
} );
|
||||
|
@ -60,8 +60,6 @@ wp_enqueue_script( 'dashboard' );
|
||||
wp_enqueue_script( 'plugin-install' );
|
||||
add_thickbox();
|
||||
|
||||
add_screen_option('layout_columns', array('max' => 4, 'default' => 2) );
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user