Fix form js coffe data toggle-link helper function for toogle buttons

This commit is contained in:
Bertocq
2017-07-04 01:03:58 +02:00
parent 339597483e
commit e87073301d

View File

@@ -15,6 +15,11 @@ App.Forms =
toggleLink: ->
$('.js-toggle-link').unbind('click').on('click', ->
$($(this).data('toggle-selector')).toggle("down")
if $(this).data('toggle-text') isnt undefined
toggle_txt = $(this).text()
$(this).text( $(this).data('toggle-text') )
$(this).data('toggle-text', toggle_txt)
false
)
@@ -22,4 +27,4 @@ App.Forms =
App.Forms.disableEnter()
App.Forms.submitOnChange()
App.Forms.toggleLink()
false
false