Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-icon-callback-option
  • Loading branch information
bbrala committed Aug 30, 2015
2 parents 093cb84 + 8b685ce commit e5fc692
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,8 @@ var // currently active contextMenu trigger

// add icons
if (item.icon) {
$t.addClass("icon icon-" + item.icon);
item._icon = ($.isFunction(item.icon)) ? item.icon.call(this, $t, key, item) : item.icon;
$t.addClass("icon icon-" + item._icon);
}
}

Expand Down Expand Up @@ -1186,6 +1187,12 @@ var // currently active contextMenu trigger

// dis- / enable item
$item[disabled ? 'addClass' : 'removeClass']('disabled');

if ($.isFunction(item.icon)) {
$item.removeClass("icon-" + item._icon);
item._icon = item.icon.call(this, $trigger, key, item);
$item.addClass("icon-" + item._icon);
}

if (item.type) {
// dis- / enable input elements
Expand Down

0 comments on commit e5fc692

Please sign in to comment.