From: Zach Copley Date: Thu, 5 Feb 2009 07:10:11 +0000 (+0000) Subject: Facebook app: don't add FBJS event listeners to notice input box if it's not on the... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=61b17b4c023776386e077f0abac6a7dfb4f0b353;p=quix0rs-gnu-social.git Facebook app: don't add FBJS event listeners to notice input box if it's not on the page --- diff --git a/js/facebookapp.js b/js/facebookapp.js index 8ef9aa532b..f0696c19e9 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) {