1
1
mirror of https://github.com/rsms/inter.git synced 2024-11-23 03:26:15 +03:00

website: fix bug in ctxedit where default explicit tracking was ignored

This commit is contained in:
Rasmus Andersson 2019-02-03 19:13:58 -08:00
parent f9f044531f
commit bc88ea81be

View File

@ -45,6 +45,7 @@ class FloatProp {
}
class FontStyleProp {
valueInStyle(s) {
let italic = s['font-style'] == 'italic' || s['font-style'].indexOf('oblique') != -1
let weight = parseFloat(s['font-weight'])
@ -146,9 +147,9 @@ class Editable {
this.el = el
this.key = key
this.defaultValues = valuesFromStyle(getComputedStyle(this.el))
// console.log('default values:', 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.loadValues()
this.updateSizeDependantProps()
@ -162,7 +163,7 @@ class Editable {
}
rmLocalObject(this.key)
rmLocalObject(this.explicitTrackingKey)
this.explicitTracking = false
this.explicitTracking = this.defaultExplicitTracking
this.updateSizeDependantProps()
}
@ -216,10 +217,7 @@ class Editable {
// console.log(`loaded values for ${this}:`, values)
}
let etr = getLocalObject(this.explicitTrackingKey)
this.explicitTracking = false
if (etr) {
this.explicitTracking = true
}
this.explicitTracking = this.defaultExplicitTracking || etr
}
isDefaultValues() {