peity
peity copied to clipboard
Avoid setting up a timer if it's unneeded
This change checks whether there are any updating-chart
elements on a page before setting up the timer that updates them.
Obviously the check is unnecessary on this page, but the demo script gets copied into themes etc. and ends up loaded on pages that don't have any updating charts, wasting CPU time and electricity.