protected_form 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f293b4f811df4c8d71d6f30cbd8b18e6a0a5124d
4
- data.tar.gz: 3f233fca063be814e0b36827eca87b58c2bf72aa
3
+ metadata.gz: 5f0828c20800b13489a8df038b9930d19eaa227e
4
+ data.tar.gz: 45a2a4457f71224bda512b3a6d8891b37751dc6f
5
5
  SHA512:
6
- metadata.gz: 32f3e572ac4b965ec84dd9cf4b6e5384f2d71d591f19ca01c85d05da636399c535e662d2ae6cd7446fe8bcb7a63b9cc44c1bb8c26e280085c67f39f8d1354382
7
- data.tar.gz: 2d3f90c1353b16ee224017b53d6921187cef7c1d13ef8e483f1474dffb74cd613dd95de79cdd821f20121ba985bbe97b3c8120ae74b3d7291be25de2c56cac06
6
+ metadata.gz: 9b9636d0d8a014b0875129cbac922f6d468d58f5925e777c6767dfde07645989931393835031d1074b0426d12b59a83ba21b2d374b0a6d856dd8fa545676e079
7
+ data.tar.gz: 459e0f142c977be7a79b9899ceeca942b96000c6c069db24ab3e2769026c7bd220680f0ebef8179e86a96b451ca4f4ca26f3030392316ce4de4579de6973c4dd
@@ -1,3 +1,3 @@
1
1
  module ProtectedForm
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  //Form Submit
24
- function sendProtectedForm() {
24
+ function sendProtectedForm(event) {
25
25
  // looking for closest .js-protected-form block
26
26
  var container = this;
27
27
  do {
@@ -40,6 +40,10 @@
40
40
 
41
41
  // and than trigger submit for this form
42
42
  form.dispatchEvent(submitEvent);
43
+ if (event) {
44
+ // Prevent double submit event
45
+ event.preventDefault();
46
+ }
43
47
  return false;
44
48
  }
45
49
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protected_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Subbotin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-14 00:00:00.000000000 Z
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Simple anti-spam wrapper for `form_for` with javascript form submission
14
14
  with changing html structure of form.