Do not alter the body's overflow attribute when the media modal is opened. Fix image insertion in the visual editor in Firefox. props azaozz. fixes #22765.

git-svn-id: https://develop.svn.wordpress.org/trunk@23085 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-12-06 03:15:39 +00:00
parent 2255750962
commit 977deb7d63
1 changed files with 4 additions and 11 deletions

View File

@ -1849,7 +1849,7 @@
container: document.body,
title: '',
propagate: true,
freeze: document.body
freeze: true
});
},
@ -1886,8 +1886,7 @@
open: function() {
var $el = this.$el,
options = this.options,
$freeze;
options = this.options;
if ( $el.is(':visible') )
return this;
@ -1895,15 +1894,11 @@
if ( ! this.views.attached )
this.attach();
// If the `freeze` option is set, record the window's scroll
// position and the body's overflow, and then set overflow to hidden.
// If the `freeze` option is set, record the window's scroll position.
if ( options.freeze ) {
$freeze = $( options.freeze );
this._freeze = {
overflow: $freeze.css('overflow'),
scrollTop: $( window ).scrollTop()
};
$freeze.css( 'overflow', 'hidden' );
}
$el.show().focus();
@ -1919,10 +1914,8 @@
this.$el.hide();
this.propagate('close');
// If the `freeze` option is set, restore the container's scroll
// position and overflow property.
// If the `freeze` option is set, restore the container's scroll position.
if ( freeze ) {
$( this.options.freeze ).css( 'overflow', freeze.overflow );
$( window ).scrollTop( freeze.scrollTop );
}