spree_quick_cart 2.1.4 → 2.1.5

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: 2fff99b1eea2df38985b6adb5325ad5d01c61869
4
- data.tar.gz: 0dd3725f1bafb29478e139673f0e775113e20eaa
3
+ metadata.gz: 2a323104143b908debd900d366c409d88bfa44b1
4
+ data.tar.gz: 1d1974f370c4a51234d1c15f4e83fdc137ee0d58
5
5
  SHA512:
6
- metadata.gz: 4edf75ad6b3d548b1555cdbaa2ec7b70f2efae08c4ac6e18bb29fab518302d2809acddc28816ecb2b3dc7b743e293f825c2edfea4170d0400445cf89d9ff038b
7
- data.tar.gz: 84d682f4315d2395cb72c35e4fcf784c58e7a5fe01c4c6274bef218c87e575722f65461e0e922ceabdccad50500b8173c1807967c7cf65915ca8a6905933ca0e
6
+ metadata.gz: f22c6f2edcf08dc1860c0e5fd8c3e9957f37e349a106fe6ebcdd68bbd8366bc6a138d69481986cb66d8d81d635a05ce79790a3f86d6009b52033dba5012e4650
7
+ data.tar.gz: 3081beea3e91f68b04f5180da3a6b5da0393212e3b932543ca933272b95d0e51f44243bee286c328e0aba747a195f42960feab1f987971b4709999719bfb6b81
@@ -5,6 +5,10 @@ function SpreeQuickCart() {
5
5
  this.initializeQuickCartForm = function() {
6
6
  $(".quick-add-to-cart-form").find("form").submit(function() {
7
7
  that.current_order_path = $(this).closest(".quick-add-to-cart-form").find('.current-order-path').text();
8
+
9
+ that.submitButton = $(this).find("button");
10
+ that.buttonEnabled(false);
11
+
8
12
  Spree.ajax({
9
13
  url: $(this).attr("action"),
10
14
  type: "POST",
@@ -15,6 +19,9 @@ function SpreeQuickCart() {
15
19
  },
16
20
  error: function(data, textStatus, jqXHR) {
17
21
  that.showFlashMessage('There was a problem adding the item to the cart. Please reload the page and try again.', false);
22
+ },
23
+ complete: function() {
24
+ that.buttonEnabled(true);
18
25
  }
19
26
  });
20
27
  return false;
@@ -48,6 +55,14 @@ function SpreeQuickCart() {
48
55
  });
49
56
  };
50
57
 
58
+ this.buttonEnabled = function(enabled) {
59
+ if (enabled == false){
60
+ that.submitButton.attr("disabled", "disabled");
61
+ } else {
62
+ that.submitButton.removeAttr("disabled");
63
+ }
64
+ };
65
+
51
66
  }
52
67
 
53
68
  $(document).ready(function() {
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = 'spree_quick_cart'
5
- s.version = '2.1.4'
5
+ s.version = '2.1.5'
6
6
  s.summary = 'Insert add to cart button in product index page'
7
7
  s.description = 'Adds js quick add to cart button to product catalogue'
8
8
  s.required_ruby_version = '>= 2.0.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_quick_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.4
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Trindade