Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/pidgin/themes/Template.html b/pidgin/themes/Template.html
- --- a/pidgin/themes/Template.html
- +++ b/pidgin/themes/Template.html
- @@ -214,12 +214,41 @@
- }
- }
- + var SCROLLMODE_UNKNOWN = 0;
- + var SCROLLMODE_WEBKIT1 = 1;
- + var SCROLLMODE_WEBKIT2 = 2;
- + var scroll_mode = SCROLLMODE_UNKNOWN;
- +
- + function detectWebkitScrolling() {
- + if (scroll_mode != SCROLLMODE_UNKNOWN)
- + return scroll_mode;
- + if (document.body.scrollTop > 0)
- + return scroll_mode = SCROLLMODE_WEBKIT1;
- + if (document.documentElement.scrollTop > 0)
- + return scroll_mode = SCROLLMODE_WEBKIT2;
- + return SCROLLMODE_UNKNOWN;
- + }
- +
- //Auto-scroll to bottom. Use nearBottom to determine if a scrollToBottom is desired.
- function nearBottom() {
- - return ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );
- + var mode = detectWebkitScrolling();
- + if (mode == SCROLLMODE_UNKNOWN || mode == SCROLLMODE_WEBKIT1) {
- + return ( document.body.scrollTop >=
- + ( document.body.offsetHeight - (window.innerHeight * 1.2) ) );
- + } else { /* SCROLLMODE_WEBKIT2 */
- + return ( document.documentElement.scrollTop >=
- + ( document.documentElement.offsetHeight - (window.innerHeight * 1.2) ) );
- + }
- }
- function scrollToBottom() {
- - document.body.scrollTop = document.body.offsetHeight;
- + var mode = detectWebkitScrolling();
- + if (mode == SCROLLMODE_UNKNOWN || mode == SCROLLMODE_WEBKIT1) {
- + document.body.scrollTop = document.body.offsetHeight;
- + } else { /* SCROLLMODE_WEBKIT2 */
- + document.documentElement.scrollTop =
- + document.documentElement.offsetHeight;
- + window.scrollTo(0, document.body.scrollHeight);
- + }
- }
- //Dynamically exchange the active stylesheet
- @@ -272,7 +301,7 @@
- }
- window.onresize = function windowDidResize(){
- - alignChat(true/*nearBottom()*/); //nearBottom buggy with inactive tabs
- + alignChat(nearBottom());
- }
- function initStyle() {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement