diff options
| author | RobertDober | 2017-04-06 19:00:24 +0200 |
|---|---|---|
| committer | RobertDober | 2017-04-07 07:07:26 +0200 |
| commit | dc515f5eda324baae5a9583f1be433ac7dcd2915 (patch) | |
| tree | 850f26f59c5f9420bd3a1ed32179c6e5e20676e2 /app/assets/javascripts/forms.coffee | |
| parent | 2a682f54f583a985809ba9ba1e33a1608f9f63b0 (diff) | |
| parent | 7ac766fb016108429730248f1a8bfd5065e8c31b (diff) | |
| download | chouette-core-dc515f5eda324baae5a9583f1be433ac7dcd2915.tar.bz2 | |
db:schema:dump
Diffstat (limited to 'app/assets/javascripts/forms.coffee')
| -rw-r--r-- | app/assets/javascripts/forms.coffee | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/assets/javascripts/forms.coffee b/app/assets/javascripts/forms.coffee index c8dd69581..9d884edcd 100644 --- a/app/assets/javascripts/forms.coffee +++ b/app/assets/javascripts/forms.coffee @@ -1,3 +1,7 @@ +# IE fix +isIE = false || !!document.documentMode +isEdge = !isIE && !!window.StyleMedia + @togglableFilter = -> $('.form-filter').on 'click', '.form-group.togglable', (e)-> if $(e.target).hasClass('togglable') || $(e.target).parent().hasClass('togglable') @@ -23,17 +27,15 @@ $('.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() + $('.formSubmitr').off() $(document).on 'ready page:load', togglableFilter $(document).on 'ready page:load', submitMover $(document).on 'ready page:load', switchInput + +if isIE || isEdge + $(document).on 'click', '.formSubmitr', (e)-> + e.preventDefault() + target = $(this).attr('form') + $('#' + target).submit() |
