Commit f63c93ab authored by david's avatar david
Browse files

Improve next timeslot rendering. #11

parent 24cdb5f5
...@@ -236,7 +236,10 @@ ...@@ -236,7 +236,10 @@
} }
} }
return "(" + str + ")";
if (str != "")
str = "(" + str + ")";
return str;
} }
/* Indicates if some fallback timeslot is playing */ /* Indicates if some fallback timeslot is playing */
...@@ -273,6 +276,15 @@ ...@@ -273,6 +276,15 @@
return false; return false;
} }
/* Displays any following timeslot */
function displayNextTimeslot(value) {
let html = "";
if ('next_timeslot' in value) {
html += displayShowName(value.next_timeslot, nonexttimeslot)
html += " " + displayShowTimes(value.next_timeslot);
}
return html;
}
/* Hack to load external CSS into the Web Component */ /* Hack to load external CSS into the Web Component */
function loadExternalCss(root, file) { function loadExternalCss(root, file) {
...@@ -693,12 +705,10 @@ ...@@ -693,12 +705,10 @@
</div> </div>
</div> </div>
{#if value.next_timeslot}
<div id="next-timeslot"> <div id="next-timeslot">
<h3 class="timeslot-title">{@html displayShowName(value.next_timeslot, nonexttimeslot)} {displayShowTimes(value.next_timeslot)}</h3> <h3 class="timeslot-title">{@html displayNextTimeslot(value)}</h3>
</div> </div>
{/if}
{:catch error} {:catch error}
<div class="error"><p>{error}</p></div> <div class="error"><p>{error}</p></div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment