From 670c8a0cb9be98a4261276c87b7a4333759e25ea Mon Sep 17 00:00:00 2001 From: jos Date: Fri, 17 Apr 2015 11:52:48 +0200 Subject: [PATCH] Fixed issues with preventDefault and with clicking achors/buttons in items on mobile devices --- lib/module/hammer.js | 2 +- package.json | 2 +- test/timeline.html | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/module/hammer.js b/lib/module/hammer.js index 120e6ef9..76c272a6 100644 --- a/lib/module/hammer.js +++ b/lib/module/hammer.js @@ -4,7 +4,7 @@ if (typeof window !== 'undefined') { var propagating = require('propagating-hammerjs'); var Hammer = window['Hammer'] || require('hammerjs'); module.exports = propagating(Hammer, { - preventDefault: true + preventDefault: 'mouse' }); } else { diff --git a/package.json b/package.json index a0f1f2c4..9e03d8eb 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "hammerjs": "^2.0.4", "keycharm": "^0.2.0", "moment": "^2.10.2", - "propagating-hammerjs": "^1.3.0" + "propagating-hammerjs": "^1.4.0" }, "devDependencies": { "babel": "^5.1.8", diff --git a/test/timeline.html b/test/timeline.html index 8c700f48..6baa872d 100644 --- a/test/timeline.html +++ b/test/timeline.html @@ -89,8 +89,13 @@ }, fieldId: '_id' }); + + var someHtml = document.createElement('div'); + someHtml.innerHTML = 'Click here or here
'; + + items.add([ - {_id: 0, content: 'item 0', start: now.clone().add(3, 'days').toDate(), title: 'hello title!'}, + {_id: 0, content: someHtml, start: now.clone().add(3, 'days').toDate(), title: 'hello title!'}, {_id: '1', content: 'item 1
start', start: now.clone().add(4, 'days').toDate()}, {_id: 2, content: 'Click here! (anchor)

' + '
Click here! (div)
', start: now.clone().add(-2, 'days').toDate() },