From 154f49e9645242a999c2043f3dfa52cb0093f2b2 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Tue, 23 Jan 2018 12:32:16 -0800 Subject: [PATCH] Toolbars: Replace $.height with clientHeight/offsetHeight Bug: T185599 Change-Id: I43fbce8f221553e9ae03f8385f39a19de01e8eb7 --- .../ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index 2b16d9631d..3f4fddfe5f 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -256,7 +256,8 @@ ve.init.mw.DesktopArticleTarget.prototype.setupToolbar = function ( surface ) { } else { setTimeout( function () { toolbar.$element - .css( 'height', toolbar.$bar.outerHeight() ) + // Avoid $bar[ 0 ].offsetHeight as this returns null in IE9 when $bar is position:fixed + .css( 'height', toolbar.$bar[ 0 ].clientHeight ) .addClass( 've-init-mw-desktopArticleTarget-toolbar-open' ); setTimeout( function () { // Clear to allow growth during use and when resizing window @@ -1151,7 +1152,8 @@ ve.init.mw.DesktopArticleTarget.prototype.teardownToolbar = function () { return deferred.resolve().promise(); } - this.toolbar.$element.css( 'height', this.toolbar.$bar.outerHeight() ); + // Avoid $bar[ 0 ].offsetHeight as this returns null in IE9 when $bar is position:fixed + this.toolbar.$element.css( 'height', this.toolbar.$bar[ 0 ].clientHeight ); setTimeout( function () { target.toolbar.$element .css( 'height', '0' )