r63806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63805‎ | r63806 | r63807 >
Date:07:40, 16 March 2010
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads JS: Better support for short browser windows -- when the edit box will not fit on the screen, try to get the top of it in, rather than the bottom.
Modified paths:
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/lqt.js
@@ -126,7 +126,12 @@
127127 var windowHeight = $j(window).height();
128128 var editBoxHeight = $j(container).height();
129129
130 - var scrollOffset = targetOffset - windowHeight + editBoxHeight;
 130+ var scrollOffset;
 131+ if ( windowHeight < editBoxHeight ) {
 132+ scrollOffset = targetOffset;
 133+ } else {
 134+ scrollOffset = targetOffset - windowHeight + editBoxHeight;
 135+ }
131136
132137 $j('html,body').animate({scrollTop: scrollOffset}, 'slow');
133138 // Auto-focus and set to auto-grow as well

Status & tagging log