Skip to content

Commit d2d69d5

Browse files
committed
Merge pull request #69 from zhangxinxu/develop
Develop
2 parents 96b3f9c + c234e0e commit d2d69d5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/mobilebone.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,6 @@
835835
|| (href.replace("://", "").split("/")[0] !== location.href.replace("://", "").split("/")[0] && ajax != "true")
836836
|| (Mobilebone.captureLink == false && ajax != "true")
837837
) return;
838-
839838
event.preventDefault();
840839
});
841840
}
@@ -849,6 +848,22 @@
849848
* If 'a' element has href, slide auto when tapping~
850849
**/
851850
Mobilebone.handleTapEvent = function(event) {
851+
/**
852+
// iscroll(set tap: true) may cause twice tap problem
853+
// which is none of Mobilebone's business
854+
// However, you can let code below go to avoid twice tap in Mobilebone
855+
// but the tap event bind out of Mobilebone also has bug
856+
// so my advice is that:
857+
// 1. use Date.now to judge as Mobilebone did;
858+
// or
859+
// 2. keep this code in the form of comment and fixed bug outside
860+
if (store.timerTap && Date.now() - store.timerTap < 100) {
861+
event.preventDefault();
862+
return false;
863+
}
864+
store.timerTap = Date.now();
865+
*/
866+
852867
// get target and href
853868
var target = event.target || event.touches[0], href = target.href;
854869
if ((!href || /a/i.test(target.tagName) == false) && (target = target.getParentElementByTag("a"))) {

0 commit comments

Comments
 (0)