From 51badc21be531b2c513432d9b74c7027c193513f Mon Sep 17 00:00:00 2001 From: mwinter Date: Wed, 26 Jan 2022 19:37:20 -0600 Subject: [PATCH] handling multiple talk titles --- public/javascripts/global.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/javascripts/global.js b/public/javascripts/global.js index d7a1661..022f5ad 100644 --- a/public/javascripts/global.js +++ b/public/javascripts/global.js @@ -672,8 +672,15 @@ function populateTalks(year, loadUpcoming) { var head, subHead; head = $('').addClass('header_span').append($('

').append(formatDate(data.date) + ': ' + data.location)); - subHead = $('
').addClass('venue').append(data.title); - $('ul#talkeventslist').addClass('content-list').prepend($('
  • ').append([head, subHead])); + if (typeof data.title === 'string') { + subHead = $('
    ').addClass('venue').append(data.title); + $('ul#talkeventslist').addClass('content-list').prepend($('
  • ').append([head, subHead])); + } else { + //assuming I do not give more than two talks a day + subHead = $('
    ').addClass('venue').append(data.title[0]); + subSubHead = $('
    ').addClass('venue').append(data.title[1]); + $('ul#talkeventslist').addClass('content-list').prepend($('
  • ').append([head, subHead, subSubHead])); + } if(loadUpcoming && alterDate(new Date(data.date)) >= new Date()){ var clonedHead = head.clone(true);