diff options
| author | jpl | 2017-03-27 12:12:13 +0200 |
|---|---|---|
| committer | jpl | 2017-03-27 12:12:13 +0200 |
| commit | b23d05eeaca3cf9563e505c8f4fbf657fdcb5299 (patch) | |
| tree | ba124c9e1361352a0867e31a94ac98c750cf87c1 /app/assets/javascripts/forms.coffee | |
| parent | ac5bdcced03ef10e4c214685ef4a3c3dc339b321 (diff) | |
| download | chouette-core-b23d05eeaca3cf9563e505c8f4fbf657fdcb5299.tar.bz2 | |
Refs #2813: fixing js listener for IE
Diffstat (limited to 'app/assets/javascripts/forms.coffee')
| -rw-r--r-- | app/assets/javascripts/forms.coffee | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/app/assets/javascripts/forms.coffee b/app/assets/javascripts/forms.coffee index 33da921b6..d350d4745 100644 --- a/app/assets/javascripts/forms.coffee +++ b/app/assets/javascripts/forms.coffee @@ -17,23 +17,21 @@ else labelCont.text(labelCont.data('checkedvalue')) -# @submitMover = -> -# if $('.page-action').children('.formSubmitr').length > 0 -# $('.page-action').children('.formSubmitr').remove() -# -# $('.formSubmitr').appendTo('.page-action') -# -# # IE fix -# isIE = false || !!document.documentMode -# isEdge = !isIE && !!window.StyleMedia -# -# if isIE || isEdge -# $('.formSubmitr').each -> -# target = $(this).attr('form') -# -# $(this).on 'click', -> -# $('#' + target).submit() +@submitMover = -> + if $('.page-action').children('.formSubmitr').length > 0 + $('.page-action').children('.formSubmitr').remove() + + $('.formSubmitr').appendTo('.page-action') + + # IE fix + isIE = false || !!document.documentMode + isEdge = !isIE && !!window.StyleMedia + + if isIE || isEdge + $(document).on 'click', '.formSubmitr', -> + target = $(this).attr('form') + $('#' + target).submit() $(document).on 'ready page:load', togglableFilter -# $(document).on 'ready page:load', submitMover +$(document).on 'ready page:load', submitMover $(document).on 'ready page:load', switchInput |
