Skip to content

Commit

Permalink
apply/destroy carousel in launcher plugin when it's active/inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadfh committed Oct 29, 2017
1 parent 1638044 commit 0eb5b98
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions scripts/buildfire/components/carouselLight/carouselLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,27 @@ buildfire.components.carousel.view.prototype = {

var self = this;

function validateLauncherCarousel() {
buildfire.getContext(function (err, result) {
if (result && result.device && result.device.platform && result.device.platform.toLowerCase() == 'ios') {
buildfire.navigation.onAppLauncherActive(function () {
self._applySlider();
}, true);
buildfire.navigation.onAppLauncherInactive(function () {
self._destroySlider();
}, true);
}
});
}

if (this.config.items && this.config.items.length > 0) {
this._renderHTMLItems(function () {
self._applySlider();

buildfire.getContext(function (err, result) {
if (result && result.device && result.device.platform && result.device.platform.toLowerCase() == 'ios') {
buildfire.navigation.onAppLauncherActive(function () {
self._applySlider();
}, true);
buildfire.navigation.onAppLauncherInactive(function () {
self._destroySlider();
}, true);
}
});
validateLauncherCarousel();
});
} else{
self._applySlider();
validateLauncherCarousel();
}
},
_destroySlider: function () {
Expand Down

0 comments on commit 0eb5b98

Please sign in to comment.