]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Facebook app: don't add FBJS event listeners to notice input box if it's not on the...
authorZach Copley <zach@controlyourself.ca>
Thu, 5 Feb 2009 07:10:11 +0000 (07:10 +0000)
committerZach Copley <zach@controlyourself.ca>
Thu, 5 Feb 2009 07:10:11 +0000 (07:10 +0000)
js/facebookapp.js

index 8ef9aa532bf79f5f3f330a1c8a882594dd2ce111..f0696c19e92618aaaa8de72975892a1c318bfcde 100644 (file)
 var max = 140;
 var noticeBox = document.getElementById('notice_data-text'); 
 
-noticeBox.addEventListener('keyup', keypress);
-noticeBox.addEventListener('keydown', keypress);
-noticeBox.addEventListener('keypress', keypress);
-noticeBox.addEventListener('change', keypress);
+if (noticeBox) {
+    noticeBox.addEventListener('keyup', keypress);
+    noticeBox.addEventListener('keydown', keypress);
+    noticeBox.addEventListener('keypress', keypress);
+    noticeBox.addEventListener('change', keypress);
+}
 
 // Do our the countdown
 function keypress(evt) {