diff --git a/bower.json b/bower.json index 2c678af..6adfddd 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-ez-plus", - "version": "1.0.6", + "version": "1.0.7", "author": { "name": "Igor Lino", "url": "http://igorlino.github.io/angular-elevatezoom-plus/" @@ -28,7 +28,7 @@ "dependencies": { "jquery": "~2.1.1", "angular": "~1.3.4", - "ez-plus": "~1.1.3" + "ez-plus": "~1.1.4" }, "devDependencies": { }, diff --git a/js/ezplus.directive.js b/js/ezplus.directive.js index e4f89f1..ee67ed5 100644 --- a/js/ezplus.directive.js +++ b/js/ezplus.directive.js @@ -9,7 +9,14 @@ restrict: 'A', scope: { ezpModel: '=', - ezpOptions: '=' + ezpOptions: '=', + onComplete: '=ezpOnComplete', + onDestroy: '=ezpOnDestroy', + onImageClick: '=ezpOnImageClick', + onImageSwap: '=ezpOnImageSwap', + onImageSwapComplete: '=ezpOnImageSwapComplete', + onShow: '=ezpOnShow', + onZoomedImageLoaded: '=ezpOnZoomedImageLoaded' }, link: link }; @@ -19,7 +26,44 @@ link.$inject = ['$scope', '$element', '$attributes']; function link($scope, $element, $attributes) { - var options = {}; + var options = { + onComplete: function () { + if ($scope.onComplete()) { + $scope.onComplete()(); + } + }, + onDestroy: function () { + if ($scope.onDestroy()) { + $scope.onDestroy()(); + } + }, + onImageClick: function () { + if ($scope.onImageClick()) { + $scope.onImageClick()(); + } + }, + + onImageSwap: function () { + if ($scope.onImageSwap()) { + $scope.onImageSwap()(); + } + }, + onImageSwapComplete: function () { + if ($scope.onImageSwapComplete()) { + $scope.onImageSwapComplete()(); + } + }, + onShow: function () { + if ($scope.onShow()) { + $scope.onShow()(); + } + }, + onZoomedImageLoaded: function () { + if ($scope.onZoomedImageLoaded()) { + $scope.onZoomedImageLoaded()(); + } + } + }; //generic way that sets all (non-function) parameters of elevate zoom plus. if ($scope.ezpOptions) { diff --git a/package.json b/package.json index 72e7bfa..7ef3314 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-ez-plus", - "version": "1.0.6", + "version": "1.0.7", "title": "Angular EZ Plus", "description": "Angular directive for ElevateZoom Plus.", "keywords": [