{"action":"created","issue":{"url":"https://api.github.com/repos/fmtvp/tal/issues/264","labels_url":"https://api.github.com/repos/fmtvp/tal/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/fmtvp/tal/issues/264/comments","events_url":"https://api.github.com/repos/fmtvp/tal/issues/264/events","html_url":"https://github.com/fmtvp/tal/pull/264","id":89598324,"number":264,"title":"Fix adding multiple event handlers with same function body","user":{"login":"bastuijnman","id":851354,"avatar_url":"https://avatars.githubusercontent.com/u/851354?v=3","gravatar_id":"","url":"https://api.github.com/users/bastuijnman","html_url":"https://github.com/bastuijnman","followers_url":"https://api.github.com/users/bastuijnman/followers","following_url":"https://api.github.com/users/bastuijnman/following{/other_user}","gists_url":"https://api.github.com/users/bastuijnman/gists{/gist_id}","starred_url":"https://api.github.com/users/bastuijnman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastuijnman/subscriptions","organizations_url":"https://api.github.com/users/bastuijnman/orgs","repos_url":"https://api.github.com/users/bastuijnman/repos","events_url":"https://api.github.com/users/bastuijnman/events{/privacy}","received_events_url":"https://api.github.com/users/bastuijnman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-06-19T15:56:36Z","updated_at":"2015-07-09T17:09:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fmtvp/tal/pulls/264","html_url":"https://github.com/fmtvp/tal/pull/264","diff_url":"https://github.com/fmtvp/tal/pull/264.diff","patch_url":"https://github.com/fmtvp/tal/pull/264.patch"},"body":"Hello,\r\n\r\nWhen trying to add multiple event listeners to a widget, with the same function body, only the first event gets fired. This is because the events are stored on an object with the function as a key. Because javascript internally does `.toString` on the function when applying it as key it can only store one event with that function body.\r\n\r\nNormally this is not a problem, but when using `.bind` the function body will automatically become `function () { [native code] }` and thus only one bound function will be able to be set to that listener.\r\n\r\nThis fix checks for the function reference itself and thus is able to add multiple bound event listeners."},"comment":{"url":"https://api.github.com/repos/fmtvp/tal/issues/comments/120074340","html_url":"https://github.com/fmtvp/tal/pull/264#issuecomment-120074340","issue_url":"https://api.github.com/repos/fmtvp/tal/issues/264","id":120074340,"user":{"login":"bastuijnman","id":851354,"avatar_url":"https://avatars.githubusercontent.com/u/851354?v=3","gravatar_id":"","url":"https://api.github.com/users/bastuijnman","html_url":"https://github.com/bastuijnman","followers_url":"https://api.github.com/users/bastuijnman/followers","following_url":"https://api.github.com/users/bastuijnman/following{/other_user}","gists_url":"https://api.github.com/users/bastuijnman/gists{/gist_id}","starred_url":"https://api.github.com/users/bastuijnman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastuijnman/subscriptions","organizations_url":"https://api.github.com/users/bastuijnman/orgs","repos_url":"https://api.github.com/users/bastuijnman/repos","events_url":"https://api.github.com/users/bastuijnman/events{/privacy}","received_events_url":"https://api.github.com/users/bastuijnman/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T17:09:43Z","updated_at":"2015-07-09T17:09:43Z","body":"Hi Tom,\r\n\r\nThat's a bit of a weird case :smile: but I added the check + an extra test for the widget.js\r\n\r\nKind regards,\r\n\r\nBas Tuijnman - 24i"}}