You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
351 B
CoffeeScript
12 lines
351 B
CoffeeScript
10 years ago
|
module.exports = (map, object, domElement) ->
|
||
|
Object.keys(map).forEach (key) ->
|
||
|
if typeof map[key] == "function"
|
||
|
valueFunc = map[key]
|
||
|
|
||
|
object.on "changed:#{key}", (val) ->
|
||
|
[targetName, actualValue] = valueFunc(val)
|
||
|
domElement.css targetName, actualValue
|
||
|
else
|
||
|
object.on "changed:#{key}", (val) ->
|
||
|
domElement.css map[key], val
|