diff --git src/wp-admin/css/customize-widgets.css src/wp-admin/css/customize-widgets.css
index f8530a1..b6b62d1 100644
|
|
|
54 | 54 | position: fixed; |
55 | 55 | left: 299px; |
56 | 56 | top: 25%; |
57 | | padding: 20px; |
58 | 57 | border: 1px solid rgb(229, 229, 229); |
59 | 58 | z-index: -1; |
| 59 | overflow: auto; |
| 60 | } |
| 61 | .customize-control-widget_form.wide-widget-control .widget-inside > .form { |
| 62 | padding: 20px; |
60 | 63 | } |
61 | 64 | .customize-control-widget_form.wide-widget-control.collapsing .widget-inside { |
62 | 65 | z-index: -2; |
diff --git src/wp-admin/js/customize-widgets.js src/wp-admin/js/customize-widgets.js
index a489b6e..425e3db 100644
|
|
var WidgetCustomizer = ( function ($) { |
703 | 703 | _setupWideWidget: function () { |
704 | 704 | var control = this, |
705 | 705 | widget_inside, |
| 706 | widget_form, |
706 | 707 | customize_sidebar, |
707 | 708 | position_widget, |
708 | 709 | theme_controls_container; |
… |
… |
var WidgetCustomizer = ( function ($) { |
712 | 713 | } |
713 | 714 | |
714 | 715 | widget_inside = control.container.find( '.widget-inside' ); |
| 716 | widget_form = widget_inside.find( '> .form' ); |
715 | 717 | customize_sidebar = $( '.wp-full-overlay-sidebar-content:first' ); |
716 | 718 | control.container.addClass( 'wide-widget-control' ); |
717 | 719 | |
… |
… |
var WidgetCustomizer = ( function ($) { |
725 | 727 | * element is at the same top position as the widget-top. When the |
726 | 728 | * widget-top is scrolled out of view, keep the widget-top in view; |
727 | 729 | * 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). |
728 | 733 | */ |
729 | 734 | position_widget = function () { |
730 | 735 | 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 | ); |
739 | 747 | widget_inside.css( 'top', top ); |
740 | 748 | }; |
741 | 749 | |
… |
… |
var WidgetCustomizer = ( function ($) { |
1375 | 1383 | return; |
1376 | 1384 | } |
1377 | 1385 | |
1378 | | complete; |
1379 | 1386 | if ( do_expand ) { |
1380 | 1387 | // Close all other widget controls before expanding this one |
1381 | 1388 | wp.customize.control.each( function ( other_control ) { |
… |
… |
var WidgetCustomizer = ( function ($) { |
1384 | 1391 | } |
1385 | 1392 | } ); |
1386 | 1393 | |
1387 | | control.container.trigger( 'expand' ); |
1388 | | control.container.addClass( 'expanding' ); |
1389 | 1394 | complete = function () { |
1390 | 1395 | control.container.removeClass( 'expanding' ); |
1391 | 1396 | control.container.addClass( 'expanded' ); |
… |
… |
var WidgetCustomizer = ( function ($) { |
1396 | 1401 | } else { |
1397 | 1402 | inside.slideDown( 'fast', complete ); |
1398 | 1403 | } |
| 1404 | control.container.trigger( 'expand' ); |
| 1405 | control.container.addClass( 'expanding' ); |
1399 | 1406 | } else { |
1400 | 1407 | control.container.trigger( 'collapse' ); |
1401 | 1408 | control.container.addClass( 'collapsing' ); |