Skip to content

Commit

Permalink
Merge pull request JabbR#568 from dpatti/ie-scroll-fix
Browse files Browse the repository at this point in the history
Another attempt to fix Chrome bug without breaking IE
  • Loading branch information
davidfowl committed Aug 1, 2012
2 parents 483b4f0 + 14608ce commit 25de2cd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions JabbR/Chat.ui.js
Expand Up @@ -162,14 +162,12 @@
};

this.scrollToBottom = function () {
var height = this.messages[0].scrollHeight - this.messages.height();

this.messages
// Fix for bug in Chrome
.scrollTop(height - 1)
// Still use full scrollHeight since height is not the best you
// can do if there is a horizontal scrollbar
.scrollTop(this.messages[0].scrollHeight);
// IE will repaint if we do the Chrome bugfix and look jumpy
if ($.browser.webkit) {
// Chrome fix for hiding and showing scroll areas
this.messages.scrollTop(0);
}
this.messages.scrollTop(this.messages[0].scrollHeight);
};

this.isNearTheEnd = function () {
Expand Down

0 comments on commit 25de2cd

Please sign in to comment.