Index: trunk/extensions/UploadWizard/js/mw.UploadWizard.js |
— | — | @@ -2353,18 +2353,18 @@ |
2354 | 2354 | $j('<p/>').append( |
2355 | 2355 | gM( 'mwe-upwiz-thanks-wikitext' ), |
2356 | 2356 | $j( '<br />' ), |
2357 | | - $j( '<textarea class="mwe-long-textarea" rows="1"/>' ) |
| 2357 | + $j( '<textarea class="mwe-long-textarea" rows="2"/>' ) |
2358 | 2358 | .growTextArea() |
2359 | 2359 | .append( thumbWikiText ) |
2360 | | - .trigger('change') |
| 2360 | + .trigger('resizeEvent') |
2361 | 2361 | ), |
2362 | 2362 | $j('<p/>').append( |
2363 | 2363 | gM( 'mwe-upwiz-thanks-url' ), |
2364 | 2364 | $j( '<br />' ), |
2365 | | - $j( '<textarea class="mwe-long-textarea" rows="1"/>' ) |
| 2365 | + $j( '<textarea class="mwe-long-textarea" rows="2"/>' ) |
2366 | 2366 | .growTextArea() |
2367 | 2367 | .append( upload.imageinfo.descriptionurl ) |
2368 | | - .trigger('change') |
| 2368 | + .trigger('resizeEvent') |
2369 | 2369 | ) |
2370 | 2370 | ) |
2371 | 2371 | ); |
— | — | @@ -2990,13 +2990,19 @@ |
2991 | 2991 | |
2992 | 2992 | var resizeIfNeeded = function() { |
2993 | 2993 | // this is the dom element |
2994 | | - while (this.scrollHeight > this.offsetHeight) { |
| 2994 | + // is there a better way to do this? |
| 2995 | + if (this.scrollHeight >= this.offsetHeight) { |
2995 | 2996 | this.rows++; |
| 2997 | + while (this.scrollHeight > this.offsetHeight) { |
| 2998 | + this.rows++; |
| 2999 | + } |
2996 | 3000 | } |
2997 | 3001 | return this; |
2998 | 3002 | }; |
2999 | 3003 | |
3000 | 3004 | this.addClass( 'mwe-grow-textarea' ); |
| 3005 | + |
| 3006 | + this.bind( 'resizeEvent', resizeIfNeeded ); |
3001 | 3007 | |
3002 | 3008 | this.keyup( resizeIfNeeded ); |
3003 | 3009 | this.change( resizeIfNeeded ); |