From 9f6e4e15ecaee8812e882cc1c3bbb684789c271b Mon Sep 17 00:00:00 2001 From: Igor Lino Date: Thu, 18 Jun 2015 15:11:57 +0200 Subject: [PATCH] Use showHideZoomContainer when closing/opening zoom. Update to latest EZP with new api. Version bump. --- bower.json | 4 ++-- js/angular-ezplus.js | 40 ++++++++++++++++++++++++---------------- package.json | 4 ++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/bower.json b/bower.json index 1011b1e..5b728ad 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "angular-ez-plus", - "version": "1.1.2", + "version": "1.1.3", "author": { "name": "Igor Lino", "url": "http://igorlino.github.io/angular-elevatezoom-plus/" @@ -27,7 +27,7 @@ "dependencies": { "jquery": "~2.1.1", "angular": "~1.3.4", - "ez-plus": "~1.1.5" + "ez-plus": "~1.1.6" }, "devDependencies": { }, diff --git a/js/angular-ezplus.js b/js/angular-ezplus.js index a56b5d8..f2e6baa 100644 --- a/js/angular-ezplus.js +++ b/js/angular-ezplus.js @@ -79,20 +79,10 @@ } $scope.$on("ezp-hidesAll", function (e, msg) { - var plugin = angular.element($element).data('ezPlus'); - if (plugin) { - plugin.showHideWindow('hide'); - plugin.showHideTint('hide'); - plugin.showHideLens('hide'); - } + hideZoom(); }); $scope.$on("ezp-showAll", function (e, msg) { - var plugin = angular.element($element).data('ezPlus'); - if (plugin) { - plugin.showHideWindow('show'); - plugin.showHideTint('show'); - plugin.showHideLens('show'); - } + showZoom(); }); $scope.$on("ezp-disableZoom", function (e, msg) { var plugin = angular.element($element).data('ezPlus'); @@ -115,15 +105,14 @@ var plugin = angular.element($element).data('ezPlus'); if (plugin) { if (image) { - plugin.showHideWindow('hide'); - plugin.showHideTint('hide'); - plugin.showHideLens('hide'); + hideZoom(); if (loader) { plugin.swaptheimage(loader, loader); } var initialUrl = getInitialUrl(smallUrl); plugin.swaptheimage(initialUrl, largeUrl); + showZoom(); } else { plugin.closeAll(); } @@ -158,7 +147,26 @@ $element.remove(); }); - + function hideZoom() { + var action='hide'; + var plugin = angular.element($element).data('ezPlus'); + if (plugin) { + plugin.showHideZoomContainer(action); + plugin.showHideWindow(action); + plugin.showHideTint(action); + plugin.showHideLens(action); + } + } + function showZoom() { + var action='show'; + var plugin = angular.element($element).data('ezPlus'); + if (plugin) { + plugin.showHideLens(action); + plugin.showHideTint(action); + plugin.showHideWindow(action); + plugin.showHideZoomContainer(action); + } + } } } diff --git a/package.json b/package.json index f124fcf..a9807b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-ez-plus", - "version": "1.1.2", + "version": "1.1.3", "title": "Angular EZ Plus", "description": "Angular directive for ElevateZoom Plus.", "keywords": [ @@ -32,7 +32,7 @@ "dependencies": { "jquery": ">=2.1.4", "angular": "~1.3.4", - "ez-plus": "~1.1.5" + "ez-plus": "~1.1.6" }, "devDependencies": { "grunt": "^0.4.5",