Skip to content

Commit

Permalink
fixing iOS "click" compatibility problem - #83
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Dec 29, 2012
1 parent a63c9fa commit 2d6c9d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ $.contextMenu is published under the [MIT license](http://www.opensource.org/lic
* adding export of internal functions and event handlers - ([Issue 101](https://github.com/medialize/jQuery-contextMenu/issues/101))
* adding class `context-menu-active` to define state on active trigger element - ([Issue 92](https://github.com/medialize/jQuery-contextMenu/issues/92))
* adding [demo for TouchSwipe](http://medialize.github.com/jQuery-contextMenu/demo/trigger-swipe.html) activation
* fixing iOS "click" compatibility problem - ([Issue 83](https://github.com/medialize/jQuery-contextMenu/issues/83))


### 1.5.25 ###
Expand Down
12 changes: 8 additions & 4 deletions demo/trigger-swipe.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ <h3 id="code">Example code: Swipe Trigger</h3>
"edit": {name: "Edit", icon: "edit"},
"cut": {name: "Cut", icon: "cut"},
"copy": {name: "Copy", icon: "copy"},
"paste": {name: "Paste", icon: "paste"},
"delete": {name: "Delete", icon: "delete"},
"sep1": "---------",
"quit": {name: "Quit", icon: "quit"}
"fold1a": {
"name": "Some submenu",
"items": {
"fold1a-key1": {"name": "echo"},
"fold1a-key2": {"name": "foxtrot"},
"fold1a-key3": {"name": "golf"}
}
}
}
});
});
Expand Down
4 changes: 4 additions & 0 deletions src/jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,10 @@ var // currently active contextMenu trigger
$label = null,
$input = null;

// iOS needs to see a click-event bound to an element to actually
// have the TouchEvents infrastructure trigger the click event
$t.on('click', $.noop);

item.$node = $t.data({
'contextMenu': opt,
'contextMenuRoot': root,
Expand Down

0 comments on commit 2d6c9d6

Please sign in to comment.