From 5d027d64fd64166048f8bb1eb3b677ae965c085b Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 25 Apr 2017 16:41:26 +0000 Subject: [PATCH] Widgets: Improve the News dashboard widget no-js notice. In the rare case this notice was displayed, it was unstyled. Uses the notice error style to make it prettier and consistent with other no-js notices. Also, some CSS clean-up. Fixes #40529. git-svn-id: https://develop.svn.wordpress.org/trunk@40556 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/dashboard.css | 14 ++++++++------ src/wp-admin/includes/dashboard.php | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/css/dashboard.css b/src/wp-admin/css/dashboard.css index d467f0c59f..98fb99378d 100644 --- a/src/wp-admin/css/dashboard.css +++ b/src/wp-admin/css/dashboard.css @@ -308,19 +308,21 @@ padding: 0; } -#dashboard_primary .widget-loading, -#dashboard_primary .dashboard-widget-control-form { +#dashboard_primary .widget-loading { padding: 12px 12px 0; + margin-bottom: 1em !important; /* Needs to override `.postbox .inside > p:last-child` in common.css */ +} + +/* Notice when JS is off. */ +#dashboard_primary .inside .notice { + margin: 0; } body #dashboard-widgets .postbox form .submit { margin: 0; } -.dashboard-widget-control-form { - overflow: hidden; -} - +/* Used only for configurable widgets. */ .dashboard-widget-control-form p { margin-top: 0; } diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index b763d43263..be0b201c9f 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -191,7 +191,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_ * @param array $meta_box */ function _wp_dashboard_control_callback( $dashboard, $meta_box ) { - echo '
'; + echo ''; wp_dashboard_trigger_widget_control( $meta_box['id'] ); wp_nonce_field( 'edit-dashboard-widget_' . $meta_box['id'], 'dashboard-widget-nonce' ); echo ''; @@ -968,7 +968,7 @@ function wp_dashboard_rss_output( $widget_id ) { * @return bool False on failure. True on success. */ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) { - $loading = '

' . __( 'Loading…' ) . '

' . __( 'This widget requires JavaScript.' ) . '

'; + $loading = '

' . __( 'Loading…' ) . '

' . __( 'This widget requires JavaScript.' ) . '

'; $doing_ajax = wp_doing_ajax(); if ( empty($check_urls) ) {