spree_quick_cart 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/store/quick_cart.js +15 -0
- data/spree_quick_cart.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a323104143b908debd900d366c409d88bfa44b1
|
|
4
|
+
data.tar.gz: 1d1974f370c4a51234d1c15f4e83fdc137ee0d58
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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() {
|
data/spree_quick_cart.gemspec
CHANGED
|
@@ -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.
|
|
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'
|