mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Add updateSelects to forms
So that in forms you don't have to find the equality for each option. Instead, just set the select value and, afterRender, call updateSelects, the options that matches the value will become selected.
This commit is contained in:
parent
10e03c87c1
commit
946436083c
1 changed files with 6 additions and 0 deletions
|
@ -93,3 +93,9 @@ module.exports.clearFormAlerts = (el) ->
|
|||
$('.alert.alert-warning', el).remove()
|
||||
el.find('.help-block.error-help-block').remove()
|
||||
el.find('.help-block.warning-help-block').remove()
|
||||
|
||||
module.exports.updateSelects = (el) ->
|
||||
el.find('select').each (i, select) ->
|
||||
value = $(select).attr('value')
|
||||
$(select).val(value)
|
||||
|
||||
|
|
Loading…
Reference in a new issue