git ssb

1+

Matt McKegg / mutant



Commit 536c388f797d23a553f63806d14459218037fd1a

fix apply of classList

Matt McKegg committed on 7/8/2016, 3:00:51 AM
Parent: e75defac47630de9da141ca0ca89cba54a030464

Files changed

lib/apply-properties.jschanged
lib/apply-properties.jsView
@@ -53,23 +53,22 @@
5353 }
5454 } else if (key.slice(0, 3) === 'ev-') {
5555 target.addEventListener(key.slice(3), value, true)
5656 } else if (key === 'className' || key === 'classList') {
57- if (Array.isArray(value)) {
58- value.forEach(function (v) {
57 + if (Array.isArray(valueOrObs)) {
58 + valueOrObs.forEach(function (v) {
5959 classList.add(v)
6060 })
6161 } else {
6262 classList.add(valueOrObs)
6363 }
6464 } else {
6565 target[key] = value
66 + var obs = isObservable(valueOrObs) ? valueOrObs : null
67 + if (obs) {
68 + data.releases.push(bind(target, obs, key))
69 + }
6670 }
67-
68- var obs = isObservable(valueOrObs) ? valueOrObs : null
69- if (obs) {
70- data.releases.push(bind(target, obs, key, namespace))
71- }
7271 }
7372
7473 watch(classList, function (value) {
7574 value = [].concat.apply([], value).filter(present).join(' ')

Built with git-ssb-web