Skip to content

Commit 92056c0

Browse files
authored
Merge pull request #65 from ahabeb/master
destroy carousel if the launcher is inactive
2 parents 5267c09 + 94f4646 commit 92056c0

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

widget/index.html

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,26 @@
400400
var sliderHtml = $compile(prepareSliderHTML())($scope);
401401
$('#launcherSlider').html(sliderHtml);
402402
if ($scope.data.plugins.length > 1) {
403-
$('#launcherSlider').owlCarousel({
404-
loop: false,
405-
nav: false,
406-
items: 1
403+
var renderSlider=function () {
404+
$('#launcherSlider').owlCarousel({
405+
loop: false,
406+
nav: false,
407+
items: 1
408+
});
409+
};
410+
renderSlider();
411+
buildfire.getContext(function (err, result) {
412+
if (result && result.device && result.device.platform && result.device.platform.toLowerCase() == 'ios') {
413+
buildfire.navigation.onAppLauncherActive(function () {
414+
renderSlider();
415+
}, true);
416+
buildfire.navigation.onAppLauncherInactive(function () {
417+
setTimeout(function () {
418+
$('#launcherSlider').trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
419+
$('#launcherSlider').find('.owl-stage-outer').children().unwrap();
420+
}, 200);
421+
}, true);
422+
}
407423
});
408424
}
409425
}

0 commit comments

Comments
 (0)