website: fix bug in ctxedit where default explicit tracking was ignored
This commit is contained in:
parent
f9f044531f
commit
bc88ea81be
1 changed files with 5 additions and 7 deletions
|
|
@ -45,6 +45,7 @@ class FloatProp {
|
||||||
}
|
}
|
||||||
|
|
||||||
class FontStyleProp {
|
class FontStyleProp {
|
||||||
|
|
||||||
valueInStyle(s) {
|
valueInStyle(s) {
|
||||||
let italic = s['font-style'] == 'italic' || s['font-style'].indexOf('oblique') != -1
|
let italic = s['font-style'] == 'italic' || s['font-style'].indexOf('oblique') != -1
|
||||||
let weight = parseFloat(s['font-weight'])
|
let weight = parseFloat(s['font-weight'])
|
||||||
|
|
@ -146,9 +147,9 @@ class Editable {
|
||||||
this.el = el
|
this.el = el
|
||||||
this.key = key
|
this.key = key
|
||||||
this.defaultValues = valuesFromStyle(getComputedStyle(this.el))
|
this.defaultValues = valuesFromStyle(getComputedStyle(this.el))
|
||||||
// console.log('default values:', this.defaultValues)
|
|
||||||
this.values = Object.assign({}, this.defaultValues)
|
this.values = Object.assign({}, this.defaultValues)
|
||||||
this.explicitTracking = false
|
this.defaultExplicitTracking = this.defaultValues['tracking'] != 0
|
||||||
|
this.explicitTracking = this.defaultExplicitTracking
|
||||||
this.explicitTrackingKey = this.key + ":etracking"
|
this.explicitTrackingKey = this.key + ":etracking"
|
||||||
this.loadValues()
|
this.loadValues()
|
||||||
this.updateSizeDependantProps()
|
this.updateSizeDependantProps()
|
||||||
|
|
@ -162,7 +163,7 @@ class Editable {
|
||||||
}
|
}
|
||||||
rmLocalObject(this.key)
|
rmLocalObject(this.key)
|
||||||
rmLocalObject(this.explicitTrackingKey)
|
rmLocalObject(this.explicitTrackingKey)
|
||||||
this.explicitTracking = false
|
this.explicitTracking = this.defaultExplicitTracking
|
||||||
this.updateSizeDependantProps()
|
this.updateSizeDependantProps()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -216,10 +217,7 @@ class Editable {
|
||||||
// console.log(`loaded values for ${this}:`, values)
|
// console.log(`loaded values for ${this}:`, values)
|
||||||
}
|
}
|
||||||
let etr = getLocalObject(this.explicitTrackingKey)
|
let etr = getLocalObject(this.explicitTrackingKey)
|
||||||
this.explicitTracking = false
|
this.explicitTracking = this.defaultExplicitTracking || etr
|
||||||
if (etr) {
|
|
||||||
this.explicitTracking = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isDefaultValues() {
|
isDefaultValues() {
|
||||||
|
|
|
||||||
Reference in a new issue