From 9466b540d3cd440877d24b498df67449031a8d53 Mon Sep 17 00:00:00 2001 From: Moe Date: Fri, 4 Aug 2023 13:00:53 -0700 Subject: [PATCH] fix timeline color references --- web/assets/js/bs5.timeline.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/web/assets/js/bs5.timeline.js b/web/assets/js/bs5.timeline.js index 287f82cf..ad48b78f 100644 --- a/web/assets/js/bs5.timeline.js +++ b/web/assets/js/bs5.timeline.js @@ -161,8 +161,7 @@ $(document).ready(function(){ var html = '' var preBufferHtml = '' $.each(loadedMonitors,function(monitorId,monitor){ - var itemColor = stringToColor(monitorId) - timeStripItemColors[monitorId] = itemColor + var itemColor = timeStripItemColors[monitorId]; html += `
` preBufferHtml += `
` }) @@ -660,6 +659,12 @@ $(document).ready(function(){ var html = buildSubMenuItems(allFound) sideMenuList.html(html) } + function setColorReferences(){ + $.each(loadedMonitors,function(monitorId,monitor){ + var itemColor = stringToColor(monitorId) + timeStripItemColors[monitorId] = itemColor + }) + } sideMenuList.on('click','[timeline-menu-action]',function(){ var el = $(this) var type = el.attr('timeline-menu-action') @@ -723,8 +728,8 @@ $(document).ready(function(){ openVideosTableView(monitorId) }) addOnTabOpen('timeline', async function () { - createTimeline() - await resetTimeline(getTickDate()) + setColorReferences() + refreshTimeline() drawFoundCamerasSubMenu() }) addOnTabReopen('timeline', function () {