Browse Source

Fixed issues with preventDefault and with clicking achors/buttons in items on mobile devices

flowchartTest
jos 9 years ago
parent
commit
670c8a0cb9
3 changed files with 8 additions and 3 deletions
  1. +1
    -1
      lib/module/hammer.js
  2. +1
    -1
      package.json
  3. +6
    -1
      test/timeline.html

+ 1
- 1
lib/module/hammer.js View File

@ -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 {

+ 1
- 1
package.json View File

@ -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",

+ 6
- 1
test/timeline.html View File

@ -89,8 +89,13 @@
},
fieldId: '_id'
});
var someHtml = document.createElement('div');
someHtml.innerHTML = 'Click <a href="javascript: alert(\'you clicked an anchor\');">here <span style="color: green;">or here</span></a><br><button onclick="alert(\'click\')">Click me</button>';
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<br>start', start: now.clone().add(4, 'days').toDate()},
{_id: 2, content: '<a href="javascript: alert(\'you clicked an anchor\');">Click here! (anchor)</a><br><br>' +
'<div onclick="alert(\'you clicked a div\'); ">Click here! (div)</div>', start: now.clone().add(-2, 'days').toDate() },

Loading…
Cancel
Save