famous-carousel
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -69,6 +69,10 @@ "use strict"; | ||
// Fire animStartCallback for first slide. | ||
// Fire animStartCallback & animDoneCallback for first slide. | ||
// Assumption is that first slide is shown immediately without animation. | ||
if (typeof this.options.animStartCallback === "function") { | ||
this.options.animStartCallback(this.pages[this.currentIndex].node, this.currentIndex); | ||
} | ||
if (typeof this.options.animDoneCallback === "function") { | ||
this.options.animDoneCallback(this.pages[this.currentIndex].node, this.currentIndex); | ||
} | ||
} | ||
@@ -334,2 +338,33 @@ | ||
el.setProperty("webkitBackfaceVisibility", "hidden"); | ||
//Add class(es) | ||
var slideClass = options.carouselData.slides[i].class; | ||
if (Array.isArray(slideClass)) { | ||
var _iteratorNormalCompletion2 = true; | ||
var _didIteratorError2 = false; | ||
var _iteratorError2 = undefined; | ||
try { | ||
for (var _iterator2 = slideClass[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
var objClass = _step2.value; | ||
el.addClass(objClass); | ||
} | ||
} catch (err) { | ||
_didIteratorError2 = true; | ||
_iteratorError2 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion2 && _iterator2.return) { | ||
_iterator2.return(); | ||
} | ||
} finally { | ||
if (_didIteratorError2) { | ||
throw _iteratorError2; | ||
} | ||
} | ||
} | ||
} else if (typeof slideClass === "string") { | ||
el.addClass(slideClass); | ||
} | ||
} | ||
@@ -336,0 +371,0 @@ |
{ | ||
"name": "famous-carousel", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Peace Chen", | ||
@@ -5,0 +5,0 @@ "contributors": ["Tony Alves (https://github.com/talves)"], |
@@ -22,3 +22,3 @@ ## Famo.us Carousel | ||
famous-carousel uses Browserify require. Refer to the _example_ folder for boilerplate setup. When using this as an npm module, reference it as such: | ||
famous-carousel uses Browserify require. Refer to the _example_ folder for boilerplate setup. Also supported are ES6 imports as well as a global version: | ||
@@ -79,2 +79,3 @@ //------------------------------------------------- | ||
_data_: must be a url for image, any valid html for markup, or a Famo.us node object.<BR> | ||
_class_: [optional] (array or string) CSS class to apply to the slide.<BR> | ||
_backgroundSize_: [optional] CSS background-size attribute (default `contain`)<BR> | ||
@@ -81,0 +82,0 @@ _transition_: [optional] custom transition for the given slide only (see above for format).<BR> |
@@ -28,6 +28,10 @@ /** | ||
// Fire animStartCallback for first slide. | ||
// Fire animStartCallback & animDoneCallback for first slide. | ||
// Assumption is that first slide is shown immediately without animation. | ||
if (typeof this.options.animStartCallback === "function") { | ||
this.options.animStartCallback(this.pages[this.currentIndex].node, this.currentIndex); | ||
} | ||
if (typeof this.options.animDoneCallback === "function") { | ||
this.options.animDoneCallback(this.pages[this.currentIndex].node, this.currentIndex); | ||
} | ||
} | ||
@@ -254,2 +258,12 @@ | ||
el.setProperty("webkitBackfaceVisibility", "hidden"); | ||
//Add class(es) | ||
var slideClass = options.carouselData.slides[i].class; | ||
if (Array.isArray(slideClass)) { | ||
for (let objClass of slideClass) { | ||
el.addClass(objClass); | ||
} | ||
} else if (typeof slideClass === "string") { | ||
el.addClass(slideClass); | ||
} | ||
} | ||
@@ -256,0 +270,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
106507
2168
258
1