diff --git a/README.md b/README.md
index b590f8d..4df188b 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@ contextMenu.js
contextMenu.js is a plugin to create windows like context menu with keyboard interaction, different type of inputs ,trigger events and much more.
Why contextMenu.js ?:
- - Use as simple popup or as a context menu. With some twick can be used for multi purpose.
+ - Use as simple popup or as a context menu. With some tweaking, it can be used for multiple purposes.
- Adjust position and size to fit in viewport.
- Keyboard interaction.
- - Support different type of inputs (structure object, UL list) .
+ - Support for different types of inputs (structure object, UL list) .
- Trigger Context menu with right-click, left-click,hover or any other mouse events.
- Css outside of javascript so you can edit the look of menu.
- Enable/disable options.
@@ -159,7 +159,7 @@ Inside callback this refers to trigger element.
Popup method is default when selector type is selector string , jquery object, DOM object. Menu method is default when selector type is structure object.
Context menu accept three parameters.
-
$('.trigger).contextMenu(method,selector,options)
+$('.trigger').contextMenu(method,selector,options)
1. method tells what operation to trigger . By default it is popup if selector is string type (selector notation) and menu if selector is structure object.
2. selector can be document object , jQuery object ,selector string or structure object.
3. option, there are different options to change the behaviour of context menu. This parameter is optional where all options contain some default value.
diff --git a/contextMenu.js b/contextMenu.js
index 4bb42a8..5f6812f 100644
--- a/contextMenu.js
+++ b/contextMenu.js
@@ -651,7 +651,20 @@
list.addClass('iw-mDisable');
}
- list.bind('click', fun);
+ click = function () {
+ close = methods.close.bind(this.data);
+ close( );
+ fun = this.fun.bind(this.userData);
+ fun( );
+ }
+
+ priv = {
+ data: trgr,
+ userData: option.userData,
+ fun: fun
+ }
+
+ list.bind('click', click.bind( priv ));
//to create sub menu
menuList.append(list);