From 6d403c9b29d663ce8cd6cc2dee68d098a9098cb4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 4 Jun 2013 12:48:23 -0400 Subject: [PATCH] defer path creation when possible --- dashboard-ui/scripts/Itemdetailpage.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 9e87f98bad..ecf9ed5017 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -331,10 +331,10 @@ return; } - var html = item.Status == 'Ended' ? 'Aired' : 'Airs'; + var html = ''; if (item.AirDays && item.AirDays.length) { - html += item.AirDays.length == 7 ? 'daily' : ' ' + item.AirDays.map(function (a) { + html += item.AirDays.length == 7 ? 'daily' : item.AirDays.map(function (a) { return a + "s"; }).join(','); @@ -348,7 +348,13 @@ html += ' at ' + item.AirTime; } - $('#seriesAirTime', page).show().html(html).trigger('create'); + if (html) { + html = (item.Status == 'Ended' ? 'Aired ' : 'Airs ') + html; + + $('#seriesAirTime', page).show().html(html).trigger('create'); + } else { + $('#seriesAirTime', page).hide(); + } } function renderTags(page, item) { @@ -855,10 +861,10 @@ $('#btnRemote', page).on('click', function () { RemoteControl.showMenu({ - + item: currentItem, context: getContext(currentItem), - + themeSongs: $('#themeSongsCollapsible:visible', page).length > 0, themeVideos: $('#themeVideosCollapsible:visible', page).length > 0