Skip to content

Commit cb49c85

Browse files
committed
Merge pull request #72 from dtex/gh-pages
Adding context menu options to input command events
2 parents 4fceb19 + e91d792 commit cb49c85

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ <h3 id="items">options.items</h3>
252252
<p>Events to register on &lt;input&gt; elements</p>
253253
<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>
254254
<p>Example: { command1: {name: "Foobar", type: "text", events: {keyup: function(e){alert(e.keyCode);}} }}</p>
255+
<p>The contents of the options object are passed to jQuery event.data.</p>
256+
<p>Example: { command1: {name: "Foobar", type: "text", events: {keyup: function(e){alert(e.data.$trigger.attr("id"));}} }}</p>
255257
</dd>
256258

257259
<dt id="items-value"><em>(string)</em> value</dt>

src/jquery.contextMenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ var // currently active contextMenu trigger
10511051
.on('blur', handle.blurInput);
10521052

10531053
if (item.events) {
1054-
$input.on(item.events);
1054+
$input.on(item.events, opt);
10551055
}
10561056
}
10571057

0 commit comments

Comments
 (0)