Skip to content

Commit 2d6c9d6

Browse files
committed
fixing iOS "click" compatibility problem - #83
1 parent a63c9fa commit 2d6c9d6

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ $.contextMenu is published under the [MIT license](http://www.opensource.org/lic
113113
* adding export of internal functions and event handlers - ([Issue 101](https://github.com/medialize/jQuery-contextMenu/issues/101))
114114
* adding class `context-menu-active` to define state on active trigger element - ([Issue 92](https://github.com/medialize/jQuery-contextMenu/issues/92))
115115
* adding [demo for TouchSwipe](http://medialize.github.com/jQuery-contextMenu/demo/trigger-swipe.html) activation
116+
* fixing iOS "click" compatibility problem - ([Issue 83](https://github.com/medialize/jQuery-contextMenu/issues/83))
116117

117118

118119
### 1.5.25 ###

demo/trigger-swipe.html

+8-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,14 @@ <h3 id="code">Example code: Swipe Trigger</h3>
8080
"edit": {name: "Edit", icon: "edit"},
8181
"cut": {name: "Cut", icon: "cut"},
8282
"copy": {name: "Copy", icon: "copy"},
83-
"paste": {name: "Paste", icon: "paste"},
84-
"delete": {name: "Delete", icon: "delete"},
85-
"sep1": "---------",
86-
"quit": {name: "Quit", icon: "quit"}
83+
"fold1a": {
84+
"name": "Some submenu",
85+
"items": {
86+
"fold1a-key1": {"name": "echo"},
87+
"fold1a-key2": {"name": "foxtrot"},
88+
"fold1a-key3": {"name": "golf"}
89+
}
90+
}
8791
}
8892
});
8993
});

src/jquery.contextMenu.js

+4
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,10 @@ var // currently active contextMenu trigger
927927
$label = null,
928928
$input = null;
929929

930+
// iOS needs to see a click-event bound to an element to actually
931+
// have the TouchEvents infrastructure trigger the click event
932+
$t.on('click', $.noop);
933+
930934
item.$node = $t.data({
931935
'contextMenu': opt,
932936
'contextMenuRoot': root,

0 commit comments

Comments
 (0)