Skip to content

Commit

Permalink
Merge pull request #387 from ahmadfh/master
Browse files Browse the repository at this point in the history
 apply/destroy carousel in launcher plugin when it's active/inactive
  • Loading branch information
abuturla authored Oct 30, 2017
2 parents 405db75 + c88b5f4 commit af81e5a
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 af81e5a

Please sign in to comment.