Plugins/WebKit Message View/Template.html
branchfix-autoscroll
changeset 5995 2bfcb17b7076
parent 4647 c8f4e9819f53
equal deleted inserted replaced
5989:1b816aafafdd 5995:2bfcb17b7076
   212 			}
   212 			}
   213 		}
   213 		}
   214 
   214 
   215 		//Auto-scroll to bottom.  Use nearBottom to determine if a scrollToBottom is desired.
   215 		//Auto-scroll to bottom.  Use nearBottom to determine if a scrollToBottom is desired.
   216 		function nearBottom() {
   216 		function nearBottom() {
   217 			return ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );
   217 			return ( window.scrollY >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) );
   218 		}
   218 		}
   219 		function scrollToBottom() {
   219 		function scrollToBottom() {
   220 			document.body.scrollTop = document.body.offsetHeight;
   220 			window.scrollTo(0, document.body.scrollHeight);
   221 		}
   221 		}
   222 
   222 
   223 		//Dynamically exchange the active stylesheet
   223 		//Dynamically exchange the active stylesheet
   224 		function setStylesheet( id, url ) {
   224 		function setStylesheet( id, url ) {
   225 			var code = "<style id=\"" + id + "\" type=\"text/css\" media=\"screen,print\">";
   225 			var code = "<style id=\"" + id + "\" type=\"text/css\" media=\"screen,print\">";