Make WordPress Core

Ticket #27348: 27348.patch

File 27348.patch, 5.0 KB (added by adamsilverstein, 11 years ago)

correct flashing in chrome

  • src/wp-admin/css/customize-widgets.css

     
    5454        position: fixed;
    5555        left: 299px;
    5656        top: 25%;
    57         padding: 20px;
    5857        border: 1px solid rgb(229, 229, 229);
    59         z-index: -1;
     58        overflow: auto;
    6059}
     60.customize-control-widget_form.wide-widget-control .widget-inside > .form {
     61        padding: 20px;
     62}
    6163.customize-control-widget_form.wide-widget-control.collapsing .widget-inside {
    6264        z-index: -2;
    6365}
  • src/wp-admin/js/customize-widgets.js

     
    703703                _setupWideWidget: function () {
    704704                        var control = this,
    705705                                widget_inside,
     706                                widget_form,
    706707                                customize_sidebar,
    707708                                position_widget,
    708709                                theme_controls_container;
     
    712713                        }
    713714
    714715                        widget_inside = control.container.find( '.widget-inside' );
     716                        widget_form = widget_inside.find( '> .form' );
    715717                        customize_sidebar = $( '.wp-full-overlay-sidebar-content:first' );
    716718                        control.container.addClass( 'wide-widget-control' );
    717719
     
    725727                         * element is at the same top position as the widget-top. When the
    726728                         * widget-top is scrolled out of view, keep the widget-top in view;
    727729                         * likewise, don't allow the widget to drop off the bottom of the window.
     730                         * If a widget is too tall to fit in the window, don't let the height
     731                         * exceed the window height so that the contents of the widget control
     732                         * will become scrollable (overflow:auto).
    728733                         */
    729734                        position_widget = function () {
    730735                                var offset_top = control.container.offset().top,
    731                                         height,
    732                                         top,
    733                                         max_top;
    734 
    735                                 height = widget_inside.outerHeight();
    736                                 top = Math.max( offset_top, 0 );
    737                                 max_top = $( window ).height() - height;
    738                                 top = Math.min( top, max_top );
     736                                        window_height = $( window ).height(),
     737                                        form_height = widget_form.outerHeight(),
     738                                        top;
     739                                widget_inside.css( 'max-height', window_height );
     740                                top = Math.max(
     741                                        0, // prevent top from going off screen
     742                                        Math.min(
     743                                                Math.max( offset_top, 0 ), // distance widget in panel is from top of screen
     744                                                window_height - form_height // flush up against bottom of screen
     745                                        )
     746                                );
    739747                                widget_inside.css( 'top', top );
    740748                        };
    741749
     
    13751383                                return;
    13761384                        }
    13771385
    1378                         complete;
    13791386                        if ( do_expand ) {
    13801387                                // Close all other widget controls before expanding this one
    13811388                                wp.customize.control.each( function ( other_control ) {
     
    13841391                                        }
    13851392                                } );
    13861393
    1387                                 control.container.trigger( 'expand' );
    1388                                 control.container.addClass( 'expanding' );
    13891394                                complete = function () {
    13901395                                        control.container.removeClass( 'expanding' );
    13911396                                        control.container.addClass( 'expanded' );
     
    13961401                                } else {
    13971402                                        inside.slideDown( 'fast', complete );
    13981403                                }
     1404                                control.container.trigger( 'expand' );
     1405                                control.container.addClass( 'expanding' );
    13991406                        } else {
    14001407                                control.container.trigger( 'collapse' );
    14011408                                control.container.addClass( 'collapsing' );
  • src/wp-includes/default-widgets.php

     
    478478
    479479        function __construct() {
    480480                $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.'));
    481                 $control_ops = array('width' => 400, 'height' => 350);
     481                $control_ops = array('width' => 500, 'height' => 400);
    482482                parent::__construct('text', __('Text'), $widget_ops, $control_ops);
    483483        }
    484484
     
    521521                $text = esc_textarea($instance['text']);
    522522?>
    523523                <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
    524                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
     524                <input class="wide-widget-control" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
    525525
    526                 <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
     526                <textarea class="widefat wide-widget-control" rows="16" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
    527527
    528528                <p><input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> />&nbsp;<label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Automatically add paragraphs'); ?></label></p>
    529529<?php