{"action":"opened","issue":{"url":"https://api.github.com/repos/fancyapps/fancybox/issues/2022","repository_url":"https://api.github.com/repos/fancyapps/fancybox","labels_url":"https://api.github.com/repos/fancyapps/fancybox/issues/2022/labels{/name}","comments_url":"https://api.github.com/repos/fancyapps/fancybox/issues/2022/comments","events_url":"https://api.github.com/repos/fancyapps/fancybox/issues/2022/events","html_url":"https://github.com/fancyapps/fancybox/issues/2022","id":346123979,"node_id":"MDU6SXNzdWUzNDYxMjM5Nzk=","number":2022,"title":"FancyBox generates unwanted click events","user":{"login":"acwolff","id":8150784,"node_id":"MDQ6VXNlcjgxNTA3ODQ=","avatar_url":"https://avatars0.githubusercontent.com/u/8150784?v=4","gravatar_id":"","url":"https://api.github.com/users/acwolff","html_url":"https://github.com/acwolff","followers_url":"https://api.github.com/users/acwolff/followers","following_url":"https://api.github.com/users/acwolff/following{/other_user}","gists_url":"https://api.github.com/users/acwolff/gists{/gist_id}","starred_url":"https://api.github.com/users/acwolff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acwolff/subscriptions","organizations_url":"https://api.github.com/users/acwolff/orgs","repos_url":"https://api.github.com/users/acwolff/repos","events_url":"https://api.github.com/users/acwolff/events{/privacy}","received_events_url":"https://api.github.com/users/acwolff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-31T10:17:30Z","updated_at":"2018-07-31T10:17:30Z","closed_at":null,"author_association":"NONE","body":"\r\n[This album](https://andrewolff.jalbum.net/Vecht_SaharaN_FB_ShowBug/) contains next code:\r\n    \r\n     $('[data-fancybox=\"S\"]').fancybox({\r\n    \tonInit : function() {\r\n    \t\tFancyBoxIsOpen = true;\r\n    \t\tFancyBoxInstance = $.fancybox.getInstance();\r\n        },\r\n        beforeShow : function() {\r\n    \t    \tslide_index= this.index;\r\n    \t\tslideType = this.contentType;\r\n    \t\t$(\".fancybox-button--expand\").hide();\r\n    \t\texpandShown = false;\r\n    \t\tif (typeof(pano) !== 'undefined') {\r\n    \t\t\tif (pano[slide_index] > 0) { $(\".fancybox-button--expand\").show();  expandShown = true; }\r\n    \t\t}\r\n        },\r\n        \tafterClose : function() {\r\n    \t\tFancyBoxIsOpen = false;\r\n    \t\tif (skipIndexPage && !hideCloseButton) {closeAlbum();}\t \r\n        },\r\n        clickContent:  function() {\r\n    \t\tbeep(); \r\n    \t\tif (enableSlideShow) {\r\n    \t\t\tFancyBoxInstance.SlideShow.toggle();\r\n    \t\t\treturn false;\r\n    \t\t} else {\r\n    \t\t\treturn \"next\";\r\n    \t\t}\r\n    },\r\n      mobile : {\r\n        clickContent :  function() {\r\n    \t\tbeep();\r\n    \t\tif (enableSlideShow) {\r\n    \t\t\tFancyBoxInstance.SlideShow.toggle();\r\n    \t\t\treturn false;\r\n    \t\t} else {\r\n    \t\t\treturn \"next\";\r\n    \t\t}\r\n    \t}\r\n      },\r\n    protect: true, // protect images from downloading by right-click\r\n        slideShow: {\r\n            autoStart: false,\r\n            speed: viewtime\r\n        },\r\n        transitionEffect: transeffect,\r\n        transitionDuration: transtime,\r\n        buttons : [\r\n        'expand',\r\n        'zoom',\r\n        'slideShow',\r\n        'thumbs',\r\n     'close'\r\n      ]\r\n    });\r\n\r\nThis code shows an extra expansion button in case of an panoramic picture and clicking in the images starts /stop the slide show.\r\nHowever that is not correctly working because unwanted click events are generated if an expansion button is showed and in case the window is resized.\r\n\r\nTo prove this I added a beep() function which produces a sound if the click event is triggered.\r\n\r\nTo see the problem [click here](https://andrewolff.jalbum.net/Vecht_SaharaN_FB_ShowBug/)  to open the album. Click next on a thumbnail to open fancyBox and resize the window, you will hear the sound.\r\nYou hear the sound also twice if an expansion button shows up in the tool-bar.\r\n\r\nHow can I prevent this unwanted click events?"}}
{"actor":{"display_login":"acwolff"}}