@wikala/spmkt 2.25.7 → 2.26.0
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.
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<div class="category-filters category-filter-component">
|
|
3
3
|
<template v-for="(filter, index) in filters">
|
|
4
4
|
<div class="filter-container">
|
|
5
|
-
<div class="filter-title">
|
|
5
|
+
<div class="filter-title" @click="expandFilter($event)">
|
|
6
6
|
<h2>{{ filter.display_name }}</h2>
|
|
7
|
-
<span class="filter-expand"
|
|
7
|
+
<span class="filter-expand"><i :class="{ 'fa': true, 'fa-plus': !isExpanded(filter.id), 'fa-minus': isExpanded(filter.id) }"></i></span>
|
|
8
8
|
</div>
|
|
9
9
|
<div :class="{ 'filter-content': true, 'is-hidden': !isExpanded(filter.id) }">
|
|
10
10
|
<div v-if="rangeTypes.includes(filter.type)" class="range-filter-container" >
|
|
@@ -98,9 +98,10 @@ export default {
|
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
expandFilter(e) {
|
|
101
|
-
let
|
|
102
|
-
let
|
|
103
|
-
|
|
101
|
+
let filterTitle = e.target.closest('.filter-title')
|
|
102
|
+
let filterContent = filterTitle.nextElementSibling
|
|
103
|
+
let expandIcon = filterTitle.querySelector('.filter-expand i')
|
|
104
|
+
|
|
104
105
|
filterContent.classList.toggle('is-hidden')
|
|
105
106
|
expandIcon.classList.toggle('fa-plus')
|
|
106
107
|
expandIcon.classList.toggle('fa-minus')
|
|
@@ -200,6 +200,7 @@ export default {
|
|
|
200
200
|
},
|
|
201
201
|
|
|
202
202
|
initHeadless() {
|
|
203
|
+
console.log('initHeadless addToCart')
|
|
203
204
|
this.$bus.$on('externalAddToCart', async (product_id, e) => {
|
|
204
205
|
let btn = e.target
|
|
205
206
|
btn.classList.add('is-loading')
|
|
@@ -209,11 +210,23 @@ export default {
|
|
|
209
210
|
})
|
|
210
211
|
this.$emit('update', resp.data.product_resource)
|
|
211
212
|
this.$nextTick(() => {
|
|
212
|
-
if (this.product.id) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
if (!this.product.id) {
|
|
214
|
+
return
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
this.product_id = this.product.id
|
|
218
|
+
if (this.product.variants.length > 0) {
|
|
219
|
+
this.$buefy.dialog.confirm({
|
|
220
|
+
title: 'Proizvod sa varijantama',
|
|
221
|
+
message: 'Otvorićemo stranicu proizvoda da biste odabrali varijantu.',
|
|
222
|
+
confirmText: 'Ok',
|
|
223
|
+
type: 'is-success',
|
|
224
|
+
onConfirm: () => {
|
|
225
|
+
window.location.href = '/'+this.product.slug;
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
btn.classList.remove('is-loading')
|
|
229
|
+
return
|
|
217
230
|
}
|
|
218
231
|
this.addToCart()
|
|
219
232
|
btn.classList.remove('is-loading')
|
|
@@ -293,9 +306,6 @@ export default {
|
|
|
293
306
|
})
|
|
294
307
|
|
|
295
308
|
this.handleBusEvents()
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
309
|
}
|
|
300
310
|
}
|
|
301
311
|
</script>
|
package/package.json
CHANGED
package/utils/animate.js
CHANGED
|
@@ -3,6 +3,10 @@ import 'animate.css'
|
|
|
3
3
|
function animateCSS(element, animationName, callback) {
|
|
4
4
|
|
|
5
5
|
const node = element instanceof HTMLElement ? element : document.querySelector(element)
|
|
6
|
+
|
|
7
|
+
if(!node) {
|
|
8
|
+
return
|
|
9
|
+
}
|
|
6
10
|
|
|
7
11
|
node.classList.add('animate__animated', 'animate__' + animationName)
|
|
8
12
|
|