Fix zaufane slider
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1099,3 +1099,50 @@ prestashop.on('updateCart', function (event) {
|
||||
// $a.replaceWith($span)
|
||||
// })
|
||||
// })
|
||||
|
||||
$(document).ready(function () {
|
||||
var $widget = $('.box-ekomi-widget')
|
||||
|
||||
$widget.css('position', 'relative').prepend(`
|
||||
<div class="preloader">
|
||||
<div class="spinner owl-carousel owl-loading"></div>
|
||||
<div class="preloader-text">Ładowanie recenzji, prosimy o chwilę cierpliwości…</div>
|
||||
</div>
|
||||
`)
|
||||
|
||||
function watchSlickTrack() {
|
||||
var $slickTrack = $widget.find('.slick-track')
|
||||
|
||||
if ($slickTrack.length) {
|
||||
var observer = new MutationObserver(function (mutationsList) {
|
||||
mutationsList.forEach(function (mutation) {
|
||||
if (
|
||||
mutation.type === 'attributes' &&
|
||||
mutation.attributeName === 'style'
|
||||
) {
|
||||
var transform = $slickTrack.css('transform')
|
||||
if (transform && transform !== 'none') {
|
||||
setTimeout(function () {
|
||||
$widget.find('.preloader').fadeOut(500)
|
||||
observer.disconnect()
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
observer.observe($slickTrack[0], {
|
||||
attributes: true,
|
||||
attributeFilter: ['style'],
|
||||
})
|
||||
} else {
|
||||
setTimeout(watchSlickTrack, 200)
|
||||
}
|
||||
}
|
||||
|
||||
watchSlickTrack()
|
||||
|
||||
setTimeout(function () {
|
||||
$widget.find('.preloader').fadeOut(500)
|
||||
}, 10000)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user