Skip to content

Commit

Permalink
Fixed arguments for callback option in documentation
Browse files Browse the repository at this point in the history
Fixes #571
  • Loading branch information
bbrala committed Jul 12, 2018
1 parent 703f2f9 commit f8939cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* Add `getting started` to the documentation.
* Fixed typo in documentation which breaks the `callback` demo.
* Fixed typo `promis` => `promise` ([Issue #633](https://github.com/swisnl/jQuery-contextMenu/issues/633)).
* Fixed arguments for callback option in documentation ([Issue #571](https://github.com/swisnl/jQuery-contextMenu/issues/571)).


#### Added

Expand Down
6 changes: 3 additions & 3 deletions documentation/demo/callback.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ currentMenu: callback
$(function(){
$.contextMenu({
selector: '.context-menu-one',
callback: function(itemKey, opt, rootMenu, originalEvent) {
callback: function(itemKey, opt, e) {
var m = "global: " + itemKey;
window.console && console.log(m) || alert(m);
},
Expand All @@ -29,7 +29,7 @@ $(function(){
name: "Edit",
icon: "edit",
// superseeds "global" callback
callback: function(itemKey, opt, rootMenu, originalEvent) {
callback: function(itemKey, opt, e) {
var m = "edit was clicked";
window.console && console.log(m) || alert(m);
}
Expand All @@ -46,4 +46,4 @@ $(function(){
</script>

## Example HTML
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
<div style="display:none;" class="showcase" data-showcase-import=".context-menu-one"></div>
2 changes: 1 addition & 1 deletion documentation/docs/items.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ If no callback and no default callback is specified, the item will not have an a
var items = {
firstCommand: {
name: "Copy",
callback: function(itemKey, opt, rootMenu, originalEvent){
callback: function(itemKey, opt, e){
// Alert the key of the item and the trigger element's id.
alert("Clicked on " + itemKey + " on element " + opt.$trigger.id);

Expand Down

0 comments on commit f8939cd

Please sign in to comment.