From 977deb7d6348dd7f861410b12dbdad8ac68c8c0d Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Thu, 6 Dec 2012 03:15:39 +0000 Subject: [PATCH] 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 --- wp-includes/js/media-views.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index b48bee9f50..4a38f7c045 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -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 ); }