diff options
author | MaZderMind | 2015-04-03 16:31:20 +0200 |
---|---|---|
committer | MaZderMind | 2015-04-03 16:32:13 +0200 |
commit | 0f4cbf90bbf82103a1c0e84ba86b2248798c6773 (patch) | |
tree | b890f0465e7d57e254c7edd4062d90bf66867415 /assets | |
parent | c769effbffbc5e0553acfc2400640e7ed824cd03 (diff) |
Immunize against missing current/upcoming talks
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/lustiges-script.js | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index bdbecde..33b84a6 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -353,22 +353,23 @@ $(function() { }); var s = nextTalk ? new Date(nextTalk.start*1000) : new Date(); - $lecture.filter('.room-'+room) - .find('.current-talk') - .removeClass('hidden') - .find('.t') - .text(currentTalk.special ? 'none' : currentTalk.title) - .end() - .end() - .find('.next-talk') - .toggleClass('hidden', !nextTalk || nextTalk.special || (nextTalk.start - now > 60*60)) - .find('strong') - .text(s.getHours()+':'+(s.getMinutes() < 10 ? '0' : '')+s.getMinutes()) - .end() - .find('.t') - .text(nextTalk ? nextTalk.title : '') - .end() - .end(); + if(currentTalk) + $lecture.filter('.room-'+room) + .find('.current-talk') + .removeClass('hidden') + .find('.t') + .text(currentTalk.special ? 'none' : currentTalk.title) + + if(nextTalk) + $lecture.filter('.room-'+room) + .find('.next-talk') + .toggleClass('hidden', !nextTalk || nextTalk.special || (nextTalk.start - now > 60*60)) + .find('strong') + .text(s.getHours()+':'+(s.getMinutes() < 10 ? '0' : '')+s.getMinutes()) + .end() + .find('.t') + .text(nextTalk ? nextTalk.title : '') + .end() }); setTimeout(updateProgtamTeaser, updateTimer); |