Comment and reformat coffee script file
This commit is contained in:
@@ -6,6 +6,7 @@ trigger_callback = (control_name,event)->
|
|||||||
cache: no
|
cache: no
|
||||||
.done (new_states)->
|
.done (new_states)->
|
||||||
states = new_states
|
states = new_states
|
||||||
|
#Update all classes
|
||||||
for name,state of states
|
for name,state of states
|
||||||
controls[name].update(state)
|
controls[name].update(state)
|
||||||
return
|
return
|
||||||
@@ -34,12 +35,16 @@ class WSF_BUTTON_CONTROL extends WSF_CONTROL
|
|||||||
update: (state) ->
|
update: (state) ->
|
||||||
@$el.text(state.text)
|
@$el.text(state.text)
|
||||||
|
|
||||||
|
#map class name to effectiv class
|
||||||
typemap =
|
typemap =
|
||||||
"WSF_BUTTON_CONTROL":WSF_BUTTON_CONTROL
|
"WSF_BUTTON_CONTROL":WSF_BUTTON_CONTROL
|
||||||
|
|
||||||
|
#create a js class for each control
|
||||||
for name,state of states
|
for name,state of states
|
||||||
|
#find control DOM element
|
||||||
$el = $('[data-name='+name+']')
|
$el = $('[data-name='+name+']')
|
||||||
|
#get control type
|
||||||
type = $el.data('type')
|
type = $el.data('type')
|
||||||
#bind widget
|
#create class
|
||||||
controls[name]=new typemap[type](name,$el)
|
controls[name]=new typemap[type](name,$el)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user