website: lab: query string now only includes customized values

This commit is contained in:
Rasmus Andersson 2019-02-02 23:23:50 -08:00
parent 09430b4e60
commit 388ee0d050

View file

@ -1628,6 +1628,7 @@ class BoundVar {
this.isNumber = e.type == 'number'
this.lastValue = this.getValue()
this.parentVars = parentVars
this.defaultValue = this.lastValue
}
refreshValue(ev) {
@ -1747,6 +1748,10 @@ class Vars {
getQueryString() {
let pairs = []
this.values.forEach((v, k) => {
let vr = this.vars.get(k)
if (vr && vr.defaultValue == v) {
return // skip
}
v = (v === true) ? 1 : (v === false || v === null) ? 0 : v
pairs.push(encodeURIComponent(k) + '=' + encodeURIComponent(v))
})