6c8e3423
Yarik
Fast buy
|
1
2
3
4
|
$(function() {
var basket = new ArtboxBasket({
'cartSelector': '#cart'
});
|
ca6ee397
Eugeny Galkovskiy
Скролл на миниатюрах
|
5
|
|
6c8e3423
Yarik
Fast buy
|
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/**
* Modal form submit code
*/
$(document)
.on('beforeSubmit', '#feedback-form', function(e) {
var f = this;
var form = $(this);
var formData = form.serialize();
$.ajax({
url: form.attr("action"),
type: form.attr("method"),
data: formData,
success: function(data) {
f.reset();
$('#feedback-modal')
.modal('hide');
$('#success-modal')
.modal('show');
},
error: function() {
$('#feedback-modal')
.modal('hide');
|
6748c345
Alexey Boroda
-Forms almost ready
|
28
|
}
|
6c8e3423
Yarik
Fast buy
|
29
30
31
32
33
|
});
})
.on('submit', '#feedback-form', function(e) {
e.preventDefault();
});
|
657a0f05
Alexey Boroda
-Button up
|
34
|
|
6c8e3423
Yarik
Fast buy
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/**
* Contact form submitting
*/
$(document)
.on('beforeSubmit', '#contact-form', function(e) {
var f = this;
var form = $(this);
var formData = form.serialize();
$.ajax({
url: form.attr("action"),
type: form.attr("method"),
data: formData,
success: function(data) {
f.reset();
form.replaceWith(data.alert);
},
error: function() {
|
83309611
Alexey Boroda
-Map in process
|
52
|
|
83309611
Alexey Boroda
-Map in process
|
53
|
}
|
6c8e3423
Yarik
Fast buy
|
54
55
56
57
58
|
});
})
.on('submit', '#contact-form', function(e) {
e.preventDefault();
});
|
4bf9edb7
Yarik
Order
|
59
|
|
6c8e3423
Yarik
Fast buy
|
60
61
62
63
64
65
66
67
68
69
70
|
/**
* Button UP code
*/
if ($('#back-to-top').length) {
var scrollTrigger = 100, // px
backToTop = function() {
var scrollTop = $(window)
.scrollTop();
if (scrollTop > scrollTrigger) {
$('#back-to-top')
.addClass('show');
|
7f57ad53
Eugeny Galkovskiy
уведомление о доб...
|
71
|
} else {
|
6c8e3423
Yarik
Fast buy
|
72
73
|
$('#back-to-top')
.removeClass('show');
|
7f57ad53
Eugeny Galkovskiy
уведомление о доб...
|
74
|
}
|
6c8e3423
Yarik
Fast buy
|
75
76
77
78
79
|
};
backToTop();
$(window)
.on('scroll', function() {
backToTop();
|
4bf9edb7
Yarik
Order
|
80
|
});
|
6c8e3423
Yarik
Fast buy
|
81
82
|
$('#back-to-top')
.on('click', function(e) {
|
4bf9edb7
Yarik
Order
|
83
|
e.preventDefault();
|
6c8e3423
Yarik
Fast buy
|
84
85
86
87
|
$('html,body')
.animate({
scrollTop: 0
}, 700);
|
4bf9edb7
Yarik
Order
|
88
|
});
|
6c8e3423
Yarik
Fast buy
|
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
}
$(document)
.on('click', '.add-to-basket', function(e) {
e.preventDefault();
var id = $(this)
.data('id');
basket.add(id, 1);
if ($('.alert-cart').length > 0) {
} else {
$('body')
.prepend($("<div class='alert-cart alert alert-success alert-dismissible'>Товар добавлен в корзину.</div>"));
setTimeout(function() {
$(".alert-cart")
.addClass("active");
}, 100);
setTimeout(function() {
$(".alert-cart")
.removeClass("active");
}, 3500);
setTimeout(function() {
$(".alert-cart")
.remove();
}, 3600);
}
});
|
4bf9edb7
Yarik
Order
|
115
|
|
6c8e3423
Yarik
Fast buy
|
116
117
118
119
120
121
122
123
124
125
126
127
128
|
$(document)
.on('click', '.remove-product-cart', function(e) {
e.preventDefault();
var id = $(this)
.parents('.product-row-basket')
.data('id');
showLoader('#basket');
var xhr = basket.remove(id);
xhr.done(function() {
$.pjax.reload({
container: '#basket',
fragment: '#basket',
timeout: 5000
|
4bf9edb7
Yarik
Order
|
129
|
});
|
6c8e3423
Yarik
Fast buy
|
130
131
|
})
});
|
4bf9edb7
Yarik
Order
|
132
|
|
6c8e3423
Yarik
Fast buy
|
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
$(document)
.on('change', '.increase-product-basket', function(e) {
var id = $(this)
.parents('.product-row-basket')
.data('id');
showLoader('#basket');
var xhr = basket.set(id, $(this)
.val());
xhr.done(function() {
$.pjax.reload({
container: '#basket',
fragment: '#basket',
timeout: 5000
});
|
4bf9edb7
Yarik
Order
|
147
|
});
|
6c8e3423
Yarik
Fast buy
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
});
$(document)
.on('click', 'li.disabled a', function(e) {
e.preventDefault();
});
$(document)
.on('submit', '#fast-buy-form', function(e) {
e.preventDefault();
});
$(document)
.on('afterValidate', '#fast-buy-form', function(e, m, errors) {
if (!errors.length) {
var form = $(e.target);
var action = form.attr('action');
$.post(action, form.serialize(), function(data) {
if (data.success) {
$('#oneclick-modal')
.find('.modal-body')
.text(data.msg);
}
});
}
}.bind(this));
|
ac6e2c67
Alexey Boroda
-Cabinet ready
|
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
$(document)
.on(
'click', '.wishlist-rm, .wishlist-add', function() {
var button = $(this);
$.ajax(
{
url: button.data('url'),
type: "POST",
data: {
'variant': button.data('variant'),
'product': button.data('product'),
'user': button.data('user')
},
success: function(data) {
button.replaceWith(data.button);
new PNotify(
{
title: 'Info',
text: data.message,
type: 'info',
styling: 'fontawesome'
}
);
}
}
)
}
);
$(document)
.on(
'click', '.wishlist-delete', function(e) {
e.preventDefault();
var button = $(this);
$.ajax(
{
url: button.data('url'),
type: "POST",
data: {
'product': button.data('product'),
'variant': button.data('variant'),
'user': button.data('user')
},
success: function(data) {
if (data.success) {
$.pjax.reload({container: '#wishlist-products'});
new PNotify(
{
title: 'Info',
text: data.message,
type: 'info',
styling: 'fontawesome'
}
);
}
}
}
);
}
);
|
6c8e3423
Yarik
Fast buy
|
237
|
});
|
4bf9edb7
Yarik
Order
|
238
239
240
|
function showLoader(container) {
$(container)
.prepend('<div class="loader-wrapper"><div class="loader"></div></div>');
|
ca6ee397
Eugeny Galkovskiy
Скролл на миниатюрах
|
241
242
243
244
245
|
}
$(document).ready(function ($) {
$('.vcovers').perfectScrollbar({wheelSpeed: 0.5});
});
|