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