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: http://core.svn.wordpress.org/trunk@23085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4f3c1bb8f1
commit
c75dc67668
|
@ -1849,7 +1849,7 @@
|
||||||
container: document.body,
|
container: document.body,
|
||||||
title: '',
|
title: '',
|
||||||
propagate: true,
|
propagate: true,
|
||||||
freeze: document.body
|
freeze: true
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1886,8 +1886,7 @@
|
||||||
|
|
||||||
open: function() {
|
open: function() {
|
||||||
var $el = this.$el,
|
var $el = this.$el,
|
||||||
options = this.options,
|
options = this.options;
|
||||||
$freeze;
|
|
||||||
|
|
||||||
if ( $el.is(':visible') )
|
if ( $el.is(':visible') )
|
||||||
return this;
|
return this;
|
||||||
|
@ -1895,15 +1894,11 @@
|
||||||
if ( ! this.views.attached )
|
if ( ! this.views.attached )
|
||||||
this.attach();
|
this.attach();
|
||||||
|
|
||||||
// If the `freeze` option is set, record the window's scroll
|
// If the `freeze` option is set, record the window's scroll position.
|
||||||
// position and the body's overflow, and then set overflow to hidden.
|
|
||||||
if ( options.freeze ) {
|
if ( options.freeze ) {
|
||||||
$freeze = $( options.freeze );
|
|
||||||
this._freeze = {
|
this._freeze = {
|
||||||
overflow: $freeze.css('overflow'),
|
|
||||||
scrollTop: $( window ).scrollTop()
|
scrollTop: $( window ).scrollTop()
|
||||||
};
|
};
|
||||||
$freeze.css( 'overflow', 'hidden' );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$el.show().focus();
|
$el.show().focus();
|
||||||
|
@ -1919,10 +1914,8 @@
|
||||||
this.$el.hide();
|
this.$el.hide();
|
||||||
this.propagate('close');
|
this.propagate('close');
|
||||||
|
|
||||||
// If the `freeze` option is set, restore the container's scroll
|
// If the `freeze` option is set, restore the container's scroll position.
|
||||||
// position and overflow property.
|
|
||||||
if ( freeze ) {
|
if ( freeze ) {
|
||||||
$( this.options.freeze ).css( 'overflow', freeze.overflow );
|
|
||||||
$( window ).scrollTop( freeze.scrollTop );
|
$( window ).scrollTop( freeze.scrollTop );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue