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