Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

fixed #544: #545

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/fastclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
function FastClick(layer, options) {
var oldOnClick;
var oldOnClickNoop = function () {};

options = options || {};

Expand Down Expand Up @@ -167,9 +168,11 @@
// - the old one won't work if passed to addEventListener directly.
oldOnClick = layer.onclick;
layer.addEventListener('click', function(event) {
oldOnClick(event);
if (layer.onclick === oldOnClickNoop) {
oldOnClick(event);
}
}, false);
layer.onclick = null;
layer.onclick = oldOnClickNoop;
}
}

Expand Down