xtras/mathuaerknedam 593:3b53facba24a: minimal_mod: Fix null ele...

commits at adium.im commits at adium.im
Sat Feb 11 17:06:27 UTC 2012


details:	http://hg.adium.im/xtras/mathuaerknedam/rev/3b53facba24a
revision:	593:3b53facba24a
branch:		(none)
author:		Adrian Godoroja <robotive at me.com>
date:		Sat Feb 11 19:06:17 2012 +0200

minimal_mod: Fix null element. Not all chats have a header (twitter).

diffs (27 lines):

diff -r c7e2b762fc51 -r 3b53facba24a Resources/Message Styles/minimal_mod.AdiumMessageStyle/Contents/Resources/Footer.js
--- a/Resources/Message Styles/minimal_mod.AdiumMessageStyle/Contents/Resources/Footer.js	Fri Nov 04 10:56:10 2011 -0500
+++ b/Resources/Message Styles/minimal_mod.AdiumMessageStyle/Contents/Resources/Footer.js	Sat Feb 11 19:06:17 2012 +0200
@@ -1,10 +1,13 @@
-// Hide the header when the user scrolls up (using the same calc as nearBottom).
-function twiddleHeader() {
-	if ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) ) {
-		document.getElementById('x-header').style.display = 'block';
-	} else {
-		document.getElementById('x-header').style.display = 'none';
-	}
-}
+// Not all chats have a header
+if (document.getElementById('x-header')) {
+    // Hide the header when the user scrolls up (using the same calc as nearBottom).
+    function twiddleHeader() {
+        if ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) ) {
+            document.getElementById('x-header').style.display = 'block';
+        } else {
+            document.getElementById('x-header').style.display = 'none';
+        }
+    }
 
-window.addEventListener("scroll", twiddleHeader, false);
+    window.addEventListener("scroll", twiddleHeader, false);
+}
\ No newline at end of file




More information about the commits mailing list