angular-owl-carousel2
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "angular-owl-carousel2", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Owl carousel 2 imp for angularjs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -7,3 +7,8 @@ # Angular Owl Carousel - 2 | ||
### Installation | ||
```ssh | ||
npm install angular-owl-carousel2 | ||
``` | ||
```ssh | ||
bower install angular-owl-carousel2 | ||
@@ -21,2 +26,2 @@ ``` | ||
``` | ||
[OwlCarousel2]: <https://github.com/OwlCarousel2/OwlCarousel2> | ||
[OwlCarousel2]: <https://github.com/OwlCarousel2/OwlCarousel2> |
@@ -9,3 +9,2 @@ /** | ||
var owlProperties = [ | ||
//OPTIONS | ||
@@ -63,3 +62,2 @@ 'items', | ||
//CLASSES | ||
'refreshClass', | ||
@@ -81,15 +79,24 @@ 'loadingClass', | ||
//EVENTS | ||
'initialize.owl.carousel', | ||
'initialized.owl.carousel', | ||
'resize.owl.carousel', | ||
'resized.owl.carousel', | ||
//CALLBACKS | ||
'onInitialize', | ||
'onInitialized', | ||
'onResize', | ||
'onResized', | ||
'onRefresh', | ||
'onRefreshed', | ||
'onDrag', | ||
'onDragged', | ||
'onTranslate', | ||
'onTranslated', | ||
'onChange', | ||
'onChanged', | ||
'onLoadLazy', | ||
'onLoadedLazy', | ||
'onStopVideo', | ||
'onPlayVideo' | ||
]; | ||
// ONLY TRIGGERABLE EVENTS | ||
var owlEvents = [ | ||
'refresh.owl.carousel', | ||
'refreshed.owl.carousel', | ||
'drag.owl.carousel', | ||
'dragged.owl.carousel', | ||
'translate.owl.carousel', | ||
'translated.owl.carousel', | ||
'change.owl.carousel', | ||
'changed.owl.carousel', | ||
'next.owl.carousel', | ||
@@ -102,11 +109,7 @@ 'prev.owl.carousel', | ||
'remove.owl.carousel', | ||
'load.owl.lazy', | ||
'loaded.owl.lazy', | ||
'play.owl.autoplay', | ||
'stop.owl.autoplay', | ||
'stop.owl.video', | ||
'play.owl.video' | ||
'stop.owl.autoplay' | ||
]; | ||
app.directive('ngOwlCarousel',['$timeout', function ($timeout) { | ||
app.directive('ngOwlCarousel', ['$timeout', function ($timeout) { | ||
return { | ||
@@ -117,3 +120,4 @@ restrict: 'E', | ||
owlItems: '=', | ||
owlProperties: '=' | ||
owlProperties: '=', | ||
owlCtrl: '=' | ||
}, | ||
@@ -124,3 +128,2 @@ transclude: true, | ||
function link($scope, $element, $attr) { | ||
var options = {}, | ||
@@ -135,2 +138,3 @@ initial = true, | ||
$scope.owlCtrl = new OwlCtrl(); | ||
@@ -171,4 +175,3 @@ $scope.$watch('[owlItems,owlProperties]', function (arr) { | ||
$timeout(function () { | ||
owlCarousel | ||
= $element.find(owlCarouselClassName).owlCarousel(options); | ||
owlCarousel = $element.find(owlCarouselClassName).owlCarousel(options); | ||
}); | ||
@@ -178,9 +181,19 @@ } | ||
function destroyOwl() { | ||
$element.find(owlCarouselClassName) | ||
.owlCarousel('destroy'); | ||
owlCarousel.owlCarousel('destroy'); | ||
} | ||
function OwlCtrl() { | ||
this.isOwlCtrl = true; | ||
} | ||
OwlCtrl.prototype.triggerEvent = function triggerEvent(event) { | ||
if (owlEvents.indexOf(event) > -1) { | ||
owlCarousel.trigger(event); | ||
} | ||
}; | ||
OwlCtrl.prototype.getOwl = function returnOwl() { | ||
return owlCarousel; | ||
}; | ||
} | ||
}]) | ||
}]); | ||
})(angularApp); | ||
Sorry, the diff of this file is not supported yet
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
8870
208
26