Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass options object to item.events handlers in event.data #72

Merged
merged 2 commits into from
Aug 31, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down