Skip to content

Commit

Permalink
1. Allow carousel to accept rendered html and convert it to a slider …
Browse files Browse the repository at this point in the history
…by passing the selector for the rendered html.

2. Allow user to pass additional options to LorySlider
  • Loading branch information
ahmadfh committed Oct 18, 2017
1 parent 1ba8cec commit 1638044
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions scripts/buildfire/components/carouselLight/carouselLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,25 @@ buildfire.components.carousel.view.prototype = {
}

var self = this;
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);
}
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);
}
});
});
});
} else{
self._applySlider();
}
},
_destroySlider: function () {
this.lorySlider.destroy();
Expand All @@ -87,13 +92,13 @@ buildfire.components.carousel.view.prototype = {
},
_applySlider: function () {
this.lorySlider = lory(this.config.selector, {
classNameSlideContainer: "js_slides",
classNameFrame: 'js_frame',
classNameSlideContainer: this.config.classNameSlideContainer || "js_slides",
classNameFrame: this.config.classNameFrame || 'js_frame',
ease: 'ease',
rewindSpeed: 600,//ms
slideSpeed: this.config.speed,//ms
slidesToScroll: 1,
infinite: 1,
slidesToScroll: this.config.slidesToScroll || 1,
infinite: this.config.infinite || 1,
enableMouseEvents: true
});

Expand Down

0 comments on commit 1638044

Please sign in to comment.