{"action":"closed","issue":{"url":"https://api.github.com/repos/swisnl/jQuery-contextMenu/issues/309","labels_url":"https://api.github.com/repos/swisnl/jQuery-contextMenu/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/swisnl/jQuery-contextMenu/issues/309/comments","events_url":"https://api.github.com/repos/swisnl/jQuery-contextMenu/issues/309/events","html_url":"https://github.com/swisnl/jQuery-contextMenu/issues/309","id":116106997,"number":309,"title":"icon function parameters are wrong 2.0","user":{"login":"RareDevil","id":9973318,"avatar_url":"https://avatars.githubusercontent.com/u/9973318?v=3","gravatar_id":"","url":"https://api.github.com/users/RareDevil","html_url":"https://github.com/RareDevil","followers_url":"https://api.github.com/users/RareDevil/followers","following_url":"https://api.github.com/users/RareDevil/following{/other_user}","gists_url":"https://api.github.com/users/RareDevil/gists{/gist_id}","starred_url":"https://api.github.com/users/RareDevil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RareDevil/subscriptions","organizations_url":"https://api.github.com/users/RareDevil/orgs","repos_url":"https://api.github.com/users/RareDevil/repos","events_url":"https://api.github.com/users/RareDevil/events{/privacy}","received_events_url":"https://api.github.com/users/RareDevil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swisnl/jQuery-contextMenu/labels/Documentation","name":"Documentation","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-10T13:35:01Z","updated_at":"2015-11-16T21:30:02Z","closed_at":"2015-11-16T21:30:02Z","body":"I have tried to use a function as a icon like the example in docs (http://swisnl.github.io/jQuery-contextMenu/docs/items.html#icon) but that dont work as intended. $itemElement is a string. \r\nWhat i can see the problem is that \"item._icon = item.icon.call(this, $t, key, item);\" dont work as intended, there is only send $t, key, item to the function.\r\nI have made a jsfiddle that shows the problem http://jsfiddle.net/RareDevil/hjs25p6q/\r\n\r\nI'm still looking at this problem to see if i can find a solution for this problem and fix it.\r\n\r\nEDIT: I have looked more into this problem and of what i can see then the problems is around line 1282 \"item._icon = item.icon.call(this, $trigger, key, item);\" something here dont add up for me here nor on line 1193 \"item._icon = item.icon.call(this, $t, key, item);\". \r\nOf what i can understand then this is how the function should look:\r\nfunction ($trigger, itemKey, item) {\r\n  // do stuff here...\r\n  // this referrer to the \"this\" in the .call(). \r\n}\r\nbut if the functions is made like that then it will fail if its called from line 1193 \"item._icon = item.icon.call(this, $t, key, item);\" since its not the same data that is used as on line 1282 \"item._icon = item.icon.call(this, $trigger, key, item);\". "}}