jenkins-bot has submitted this change and it was merged. Change subject: MessageDialog: Add Firefox hack for scrollbars when sizing dialogs ......................................................................
MessageDialog: Add Firefox hack for scrollbars when sizing dialogs Firefox sometimes produces a scrollbar when the element doesn't need one (http://i.imgur.com/8mpcLvw.png instead of http://i.imgur.com/gfJnz2J.png). Temporarily killing it (with overflow: hidden), forcing reflow and then restoring previous overflow value fixes it. Bug: T72061 Change-Id: I8430cf6fc4da3c0f8fb4ab5bd6d2847834992d9b --- M src/dialogs/MessageDialog.js 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: Trevor Parscal: Looks good to me, approved jenkins-bot: Verified diff --git a/src/dialogs/MessageDialog.js b/src/dialogs/MessageDialog.js index ab51496..9886038 100644 --- a/src/dialogs/MessageDialog.js +++ b/src/dialogs/MessageDialog.js @@ -141,6 +141,25 @@ /** * @inheritdoc */ +OO.ui.MessageDialog.prototype.setDimensions = function ( dim ) { + var $scrollable = this.container.$element; + OO.ui.MessageDialog.super.prototype.setDimensions.call( this, dim ); + + // Firefox hack: + // Twiddle the overflow property, otherwise an unnecessary scrollbar may be produced. + // Need to do it after transition completes (250ms), add 50ms just in case. + setTimeout( function () { + $scrollable.css( 'overflow', 'hidden' ); + $scrollable.height(); // Force reflow + $scrollable.css( 'overflow', '' ); + }, 300 ); + + return this; +}; + +/** + * @inheritdoc + */ OO.ui.MessageDialog.prototype.initialize = function () { // Parent method OO.ui.MessageDialog.super.prototype.initialize.call( this ); -- To view, visit https://gerrit.wikimedia.org/r/175782 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8430cf6fc4da3c0f8fb4ab5bd6d2847834992d9b Gerrit-PatchSet: 2 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński <[email protected]> Gerrit-Reviewer: Bartosz Dziewoński <[email protected]> Gerrit-Reviewer: Trevor Parscal <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
