Ticket #27348: 27348.2.patch
File 27348.2.patch, 2.8 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/customize-widgets.css
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 60 } 61 .customize-control-widget_form.wide-widget-control .widget-inside > .form { 62 padding: 20px; 63 } 61 64 .customize-control-widget_form.wide-widget-control.collapsing .widget-inside { 62 65 z-index: -2; 63 66 } -
src/wp-admin/js/customize-widgets.js
649 649 _setupWideWidget: function () { 650 650 var control = this, 651 651 widget_inside, 652 widget_form, 652 653 customize_sidebar, 653 654 position_widget, 654 655 theme_controls_container; … … 658 659 } 659 660 660 661 widget_inside = control.container.find( '.widget-inside' ); 662 widget_form = widget_inside.find( '> .form' ); 661 663 customize_sidebar = $( '.wp-full-overlay-sidebar-content:first' ); 662 664 control.container.addClass( 'wide-widget-control' ); 663 665 … … 671 673 * element is at the same top position as the widget-top. When the 672 674 * widget-top is scrolled out of view, keep the widget-top in view; 673 675 * likewise, don't allow the widget to drop off the bottom of the window. 676 * If a widget is too tall to fit in the window, don't let the height 677 * exceed the window height so that the contents of the widget control 678 * will become scrollable (overflow:auto). 674 679 */ 675 680 position_widget = function () { 676 681 var offset_top = control.container.offset().top, 677 height, 678 top, 679 max_top; 680 681 height = widget_inside.outerHeight(); 682 top = Math.max( offset_top, 0 ); 683 max_top = $( window ).height() - height; 684 top = Math.min( top, max_top ); 682 window_height = $( window ).height(), 683 form_height = widget_form.outerHeight(), 684 top; 685 widget_inside.css( 'max-height', window_height ); 686 top = Math.max( 687 0, // prevent top from going off screen 688 Math.min( 689 Math.max( offset_top, 0 ), // distance widget in panel is from top of screen 690 window_height - form_height // flush up against bottom of screen 691 ) 692 ); 685 693 widget_inside.css( 'top', top ); 686 694 }; 687 695 … … 690 698 customize_sidebar.on( 'scroll', position_widget ); 691 699 $( window ).on( 'resize', position_widget ); 692 700 theme_controls_container.on( 'expanded collapsed', position_widget ); 693 position_widget();694 701 } ); 695 702 control.container.on( 'collapsed', function () { 696 703 customize_sidebar.off( 'scroll', position_widget );