Skip to content
Browse files

Merge pull request #98 from Jako/patch-1

Close button for zoomButton elements
  • Loading branch information...
2 parents 7c25515 + c698bae commit 87ab8d9f942fbfdaf6a926df28c586c5fdd22739 @jaukia committed Mar 7, 2016
Showing with 23 additions and 16 deletions.
  1. +23 −16 jquery.zoomooz.js
View
39 jquery.zoomooz.js
@@ -1767,24 +1767,31 @@ if(!$.zoomooz) {
$selected = displayList.first();
}
- if(settings.type.indexOf("prev")===0) {
- target = displayList.prev($selected[0]);
- if(target === null) {
- if(settings.wrap) {
- target = displayList.last();
- } else {
- performZoom = false;
+ switch (settings.type) {
+ case "close":
+ target = $root;
+ break;
+ case "prev":
+ target = displayList.prev($selected[0]);
+ if (target === null) {
+ if (settings.wrap) {
+ target = displayList.last();
+ } else {
+ performZoom = false;
+ }
}
- }
- } else {
- target = displayList.next($selected[0]);
- if(target === null) {
- if(settings.wrap) {
- target = displayList.first();
- } else {
- performZoom = false;
+ break;
+ case "next":
+ default:
+ target = displayList.next($selected[0]);
+ if (target === null) {
+ if (settings.wrap) {
+ target = displayList.first();
+ } else {
+ performZoom = false;
+ }
}
- }
+ break;
}
if(performZoom) {

0 comments on commit 87ab8d9

Please sign in to comment.
Something went wrong with that request. Please try again.