Skip to content

Commit f8939cd

Browse files
committed
Fixed arguments for callback option in documentation
Fixes #571
1 parent 703f2f9 commit f8939cd

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Add `getting started` to the documentation.
88
* Fixed typo in documentation which breaks the `callback` demo.
99
* Fixed typo `promis` => `promise` ([Issue #633](https://github.com/swisnl/jQuery-contextMenu/issues/633)).
10+
* Fixed arguments for callback option in documentation ([Issue #571](https://github.com/swisnl/jQuery-contextMenu/issues/571)).
11+
1012

1113
#### Added
1214

documentation/demo/callback.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ currentMenu: callback
2020
$(function(){
2121
$.contextMenu({
2222
selector: '.context-menu-one',
23-
callback: function(itemKey, opt, rootMenu, originalEvent) {
23+
callback: function(itemKey, opt, e) {
2424
var m = "global: " + itemKey;
2525
window.console && console.log(m) || alert(m);
2626
},
@@ -29,7 +29,7 @@ $(function(){
2929
name: "Edit",
3030
icon: "edit",
3131
// superseeds "global" callback
32-
callback: function(itemKey, opt, rootMenu, originalEvent) {
32+
callback: function(itemKey, opt, e) {
3333
var m = "edit was clicked";
3434
window.console && console.log(m) || alert(m);
3535
}
@@ -46,4 +46,4 @@ $(function(){
4646
</script>
4747

4848
## Example HTML
49-
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
49+
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>

documentation/docs/items.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ If no callback and no default callback is specified, the item will not have an a
101101
var items = {
102102
firstCommand: {
103103
name: "Copy",
104-
callback: function(itemKey, opt, rootMenu, originalEvent){
104+
callback: function(itemKey, opt, e){
105105
// Alert the key of the item and the trigger element's id.
106106
alert("Clicked on " + itemKey + " on element " + opt.$trigger.id);
107107

0 commit comments

Comments
 (0)