Sha256: 5128bf3bb98080c7fbc21763e64e48f711a2ddd4907907565be3f6043045f2ab
Contents?: true
Size: 618 Bytes
Versions: 53
Compression:
Stored size: 618 Bytes
Contents
class Turbolinks.Form constructor: (@$form) -> @$form.on('submit', (e) => @submit(e)) submit: (e) -> e.preventDefault() @visit(@buildUrl()) buildUrl: -> url = @$form.attr('action') url += if url.indexOf('?') is -1 then '?' else '&' url + @$form.serialize() visit: (url) -> Turbolinks.visit(url); $(document).on "submit", "form[method='get']:not([data-no-turboform])", (e) -> $form = $(e.currentTarget) unless (turboform = $form.data('turboform-instance')) turboform = new Turbolinks.Form($form) $form.data('turboform-instance', turboform) turboform.submit(e)
Version data entries
53 entries across 53 versions & 1 rubygems