mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 16:41:18 +08:00
4d3eb3f1ac
Calling `setProperty("--header-offset", newValue)` will always cause a 'Recalculate Style' event, even if the value is unchanged. On my browser, these 'Recalculate Style' events take about 6-7ms each time the `dockCheck` function is run. This commit stores the 'previous' value in an instance variable, and only calls setProperty if the value has changed. This brings the total runtime of `dockCheck` down to about 70µs on my machine. |
||
---|---|---|
.. | ||
images | ||
javascripts | ||
stylesheets |