Permalink
Browse files

Merge pull request #72 from dtex/gh-pages

Adding context menu options to input command events
  • Loading branch information...
2 parents 4fceb19 + e91d792 commit cb49c8567db8d4bb079910c2a9ac92ac1f5b4931 @rodneyrehm rodneyrehm committed Aug 31, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 docs.html
  2. +1 −1 src/jquery.contextMenu.js
View
2 docs.html
@@ -252,6 +252,8 @@ <h3 id="items">options.items</h3>
<p>Events to register on &lt;input&gt; elements</p>
<p>Only used with <a href="#items-type">types</a> <em>"text"</em>, <em>"textarea"</em>, <em>"radio"</em>, <em>"checkbox"</em> and <em>"select"</em>.</p>
<p>Example: { command1: {name: "Foobar", type: "text", events: {keyup: function(e){alert(e.keyCode);}} }}</p>
+ <p>The contents of the options object are passed to jQuery event.data.</p>
+ <p>Example: { command1: {name: "Foobar", type: "text", events: {keyup: function(e){alert(e.data.$trigger.attr("id"));}} }}</p>
</dd>
<dt id="items-value"><em>(string)</em> value</dt>
View
2 src/jquery.contextMenu.js
@@ -1051,7 +1051,7 @@ var // currently active contextMenu trigger
.on('blur', handle.blurInput);
if (item.events) {
- $input.on(item.events);
+ $input.on(item.events, opt);
}
}

0 comments on commit cb49c85

Please sign in to comment.