Commit 90275fe4 authored by Michał Woźniak's avatar Michał Woźniak
Browse files

fewer history.pushState() calls

parent b949fd8f
Pipeline #211 passed with stage
in 2 seconds
......@@ -1114,7 +1114,6 @@ let chartGuidelineGradient = (chart, dataset) => {
// create the gradient, using p1's coords as a starting point,
// and swapped deltas to get a perpendicular vector
console.log()
var gradient = chart.ctx.createLinearGradient(x, y, x - dratio * dy, y + dratio * dx);
// get the color we're working with
......@@ -1763,10 +1762,14 @@ let updateUrlHash = () => {
var selected_settings = getSelectedSettings()
// using History.pushState() because we don't want the onhashchange event to fire
var new_hash = ''
if (selected_settings.length > 0) {
history.pushState({}, '', '#' + selected_settings.join(',') + ';' + selected_sites.join(','))
new_hash = '#' + selected_settings.join(',') + ';' + selected_sites.join(',')
} else {
history.pushState({}, '', '#' + selected_sites.join(','))
new_hash = '#' + selected_sites.join(',')
}
if (window.location.hash !== new_hash) {
history.pushState({}, '', new_hash)
}
}
......
Markdown is supported
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