r84921 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84920‎ | r84921 | r84922 >
Date:21:11, 28 March 2011
Author:hartman
Status:ok (Comments)
Tags:
Comment:
Because this element has margins, the scrollWidth will be larger by definition, causing the box to continiously grow in size when opening it multiple times.

Fixes bug 27566
Modified paths:
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js
@@ -172,7 +172,7 @@
173173 $(this).css( 'white-space', 'nowrap' );
174174 if ( wrapper.width() <= $(this).get(0).scrollWidth ) {
175175 var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0;
176 - thisWidth = Math.max( $(this).get(0).scrollWidth, thisWidth );
 176+ thisWidth = Math.max( $(this).get(0).width, thisWidth );
177177 $(this).width( thisWidth );
178178 $(this).data( 'thisWidth', thisWidth );
179179 var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0;

Follow-up revisions

RevisionCommit summaryAuthorDate
r852561.17wmf1: MFT r80813, r80815, r83798, r84459, r84729, r84820, r84921, r84985,...catrope14:13, 3 April 2011
r85437MFT last couple of extension revs: r84664, r84921, r85202demon14:29, 5 April 2011

Comments

#Comment by TheDJ (talk | contribs)   22:24, 28 March 2011

I chose to fix the bug, but that resize() function is a tad obscure, and I'm not entirely sure if all the code there is as useful and efficient as it should be. The entire function might warrant a second look, and it could be useful to figure out why this logic was added like this in the first place.

Status & tagging log