summaryrefslogtreecommitdiff
path: root/js/facebookapp.js
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-02-05 07:10:11 +0000
committerZach Copley <zach@controlyourself.ca>2009-02-05 07:10:11 +0000
commit61b17b4c023776386e077f0abac6a7dfb4f0b353 (patch)
tree5bc2efe837419e917710c7ad5bc4d0dee59b38b8 /js/facebookapp.js
parente5b075b912e1fb416e73988547e2ece8f89e6453 (diff)
Facebook app: don't add FBJS event listeners to notice input box if it's not on the page
Diffstat (limited to 'js/facebookapp.js')
-rw-r--r--js/facebookapp.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/js/facebookapp.js b/js/facebookapp.js
index 8ef9aa532..f0696c19e 100644
--- a/js/facebookapp.js
+++ b/js/facebookapp.js
@@ -19,10 +19,12 @@
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) {