timeline gets called multiple times per page load
Closed this issue · 3 comments
martzmakes commented
On a full page reload timeline gets called at least 10 times
jsachs commented
renderPlot()
is called in the following places within timeline.js:
$window.onload
(line 280)
$timeout
(line 286)
$window.onresize
(line 293)
Watch points on all the following:
- inactiveFlag
- entryType
- pageLoaded
- entryListFiltered
I'll consoleLog these call and see which ones are getting hit.
jsachs commented
From the console output, it looks like this is the order the events happen in:
- inactiveFlag
- entryType
- pageLoaded
- entryListFiltered
- timeout/DOM load
- onload
The first four are from watch points. So maybe we need a way for the watch points to not trigger the first time. pageLoaded may be redundant at this point, same with on-load.
jsachs commented
Adding the following line at the top of watch functions:
if (newValue !== oldValue)
Skips them on initialization.