Make WordPress Core

Changeset 29346


Ignore:
Timestamp:
08/01/2014 08:14:43 PM (11 years ago)
Author:
ocean90
Message:

Disable background page scrolling when modals are open.

props celloexpressions.
fixes #29074.

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r29314 r29346  
    217217    min-width: 0;
    218218    padding-top: 1px;
     219}
     220
     221body.modal-open {
     222    overflow: hidden;
    219223}
    220224
  • trunk/src/wp-admin/css/themes.css

    r29217 r29346  
    410410}
    411411
    412 body.theme-overlay-open {
    413     overflow: hidden;
    414 }
    415 
    416412.theme-overlay .theme-header {
    417413    position: absolute;
  • trunk/src/wp-admin/js/theme.js

    r29217 r29346  
    702702    // the theme details overlay
    703703    closeOverlay: function() {
    704         $( 'body' ).removeClass( 'theme-overlay-open' );
     704        $( 'body' ).removeClass( 'modal-open' );
    705705        this.remove();
    706706        this.unbind();
     
    10011001        // Sets this.view to 'detail'
    10021002        this.setView( 'detail' );
    1003         $( 'body' ).addClass( 'theme-overlay-open' );
     1003        $( 'body' ).addClass( 'modal-open' );
    10041004
    10051005        // Set up the theme details view
  • trunk/src/wp-includes/js/media-views.js

    r29332 r29346  
    32293229            }
    32303230
     3231            // Disable page scrolling.
     3232            $( 'body' ).addClass( 'modal-open' );
     3233
    32313234            $el.show().find( '.media-modal-close' ).focus();
    32323235            return this.propagate('open');
     
    32433246                return this;
    32443247            }
     3248
     3249            // Enable page scrolling.
     3250            $( 'body' ).removeClass( 'modal-open' );
    32453251
    32463252            // Hide modal and remove restricted media modal tab focus once it's closed
  • trunk/src/wp-includes/js/thickbox/thickbox.js

    r27080 r29346  
    4747                jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
    4848                jQuery("#TB_overlay").click(tb_remove);
     49                jQuery( 'body' ).addClass( 'modal-open' );
    4950            }
    5051        }
     
    265266    jQuery("#TB_closeWindowButton").unbind("click");
    266267    jQuery("#TB_window").fadeOut("fast",function(){jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("tb_unload").unbind().remove();});
     268    jQuery( 'body' ).removeClass( 'modal-open' );
    267269    jQuery("#TB_load").remove();
    268270    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
Note: See TracChangeset for help on using the changeset viewer.