Make WordPress Core


Ignore:
Timestamp:
11/27/2013 01:29:49 AM (11 years ago)
Author:
azaozz
Message:

Widgets: drop onto closed sidebars.

  • Make dropping a widget easier by preventing the source sidebar from resizing while the widget is being dragged.
  • Move widgets dropped on closed sidebars to the top. UI Sortable places them randomly near the bottom.
  • Fix possible regression in wp_list_widget_controls(), add an optional argument to output the sidebar name inside the sortable container.
  • Updated styles for sidebar description and widget-hover class.

Part props shaunandrews, fixes #25952.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/widgets.php

    r26366 r26426  
    333333    <div id="available-widgets" class="widgets-holder-wrap">
    334334        <div class="sidebar-name">
    335         <div class="sidebar-name-arrow"><br /></div>
    336         <h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3></div>
     335            <div class="sidebar-name-arrow"><br /></div>
     336            <h3><?php _e('Available Widgets'); ?> <span id="removing-widget"><?php _ex('Deactivate', 'removing-widget'); ?> <span></span></span></h3>
     337        </div>
    337338        <div class="widget-holder">
    338         <p class="description"><?php _e('Drag widgets from here to a sidebar on the right to activate them. Drag widgets back here to deactivate them and delete their settings.'); ?></p>
    339         <div id="widget-list">
    340         <?php wp_list_widgets(); ?>
    341         </div>
    342         <br class='clear' />
     339            <div class="sidebar-description">
     340                <p class="description"><?php _e('Drag widgets from here to a sidebar on the right to activate them. Drag widgets back here to deactivate them and delete their settings.'); ?></p>
     341            </div>
     342            <div id="widget-list">
     343                <?php wp_list_widgets(); ?>
     344            </div>
     345            <br class='clear' />
    343346        </div>
    344347        <br class="clear" />
     
    356359        ?>
    357360        <div class="<?php echo esc_attr( $wrap_class ); ?>">
    358             <div class="sidebar-name">
    359                 <div class="sidebar-name-arrow"><br /></div>
    360                 <h3><?php echo esc_html( $registered_sidebar['name'] ); ?> <span class="spinner"></span></h3>
    361             </div>
    362361            <div class="widget-holder inactive">
    363                 <?php wp_list_widget_controls( $registered_sidebar['id'] ); ?>
     362                <?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
    364363                <div class="clear"></div>
    365364            </div>
    366365        </div>
    367366        <?php
     367
    368368    } else {
    369369        $theme_sidebars[$sidebar] = $registered_sidebar;
     
    408408    ?>
    409409    <div class="<?php echo esc_attr( $wrap_class ); ?>">
    410         <div class="sidebar-name">
    411             <div class="sidebar-name-arrow"><br /></div>
    412             <h3><?php echo esc_html( $registered_sidebar['name'] ); ?>  <span class="spinner"></span></h3>
    413         </div>
    414         <?php wp_list_widget_controls( $sidebar ); // Show the control forms for each of the widgets in this sidebar ?>
     410        <?php wp_list_widget_controls( $sidebar, $registered_sidebar['name'] ); // Show the control forms for each of the widgets in this sidebar ?>
    415411    </div>
    416412    <?php
Note: See TracChangeset for help on using the changeset viewer.