From 400f3baee993b7d1a4cbcdc09b99d8224d8f2ac0 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 21 Jul 2013 18:34:15 -0700 Subject: fix error updating pagetitle with notify count if not logged in locally (no notify count available) --- view/theme/redbasic/js/redbasic.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'view/theme') diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index c1f67dcd5..eecd46d96 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -86,13 +86,16 @@ $('.savedsearchterm').hover( }); - $(document).ready(function(){ - var doctitle = document.title; - function checkNotify() { - if(document.getElementById("notify-update").innerHTML != "") - document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle; - else - document.title = doctitle; - }; - setInterval(function () {checkNotify();}, 10 * 1000); - }) \ No newline at end of file +$(document).ready(function(){ + var doctitle = document.title; + function checkNotify() { + var notifyUpdateElem = document.getElementById('notify-update'); + if(typeof(notifyUpdateElem) != 'undefined') { + if(notifyUpdateElem.innerHTML != "") + document.title = "("+notifyUpdateElem.innerHTML+") " + doctitle; + else + document.title = doctitle; + } + }; + setInterval(function () {checkNotify();}, 10 * 1000); +}); \ No newline at end of file -- cgit v1.2.3