{"action":"opened","number":2660,"pull_request":{"url":"https://api.github.com/repos/kangax/fabric.js/pulls/2660","id":52101464,"html_url":"https://github.com/kangax/fabric.js/pull/2660","diff_url":"https://github.com/kangax/fabric.js/pull/2660.diff","patch_url":"https://github.com/kangax/fabric.js/pull/2660.patch","issue_url":"https://api.github.com/repos/kangax/fabric.js/issues/2660","number":2660,"state":"open","locked":false,"title":"Improve event system to allow customization","user":{"login":"netheril96","id":836839,"avatar_url":"https://avatars.githubusercontent.com/u/836839?v=3","gravatar_id":"","url":"https://api.github.com/users/netheril96","html_url":"https://github.com/netheril96","followers_url":"https://api.github.com/users/netheril96/followers","following_url":"https://api.github.com/users/netheril96/following{/other_user}","gists_url":"https://api.github.com/users/netheril96/gists{/gist_id}","starred_url":"https://api.github.com/users/netheril96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netheril96/subscriptions","organizations_url":"https://api.github.com/users/netheril96/orgs","repos_url":"https://api.github.com/users/netheril96/repos","events_url":"https://api.github.com/users/netheril96/events{/privacy}","received_events_url":"https://api.github.com/users/netheril96/received_events","type":"User","site_admin":false},"body":"When I try to make an interactive canvas with fabric.js, I find its event system to be severely limiting. It does not follow the DOM event model in that the event is neither bubbling nor cancelable. This makes it hard to customize. This pull request attempts to fix this.\r\n\r\nNow the event object sent by the canvas has additional fields:\r\n\r\n* `currentTarget`: the object raising the event\r\n* `cancelBubble`: whether bubbling should be cancelled\r\n* `defaultPrevented`: whether default action should be prevented\r\n\r\nThese fields are not attached to the mouse event originated from the DOM because of cross browser issues and because it is not possible to detect if `stopPropagation` has been called.\r\n\r\nNow, a mouse event will first be raised by the target object, and if the user do not set the `cancelBubble` flag, raised again by the parent object (now the only possible parent is the canvas, but in the future, the group could be seen as the parent of its composite objects). And if the `defaultPrevented` flag has been set, the default action like selecting, dragging, transforming will not be done.","created_at":"2015-11-30T09:35:19Z","updated_at":"2015-11-30T09:35:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e02cb064aa4f905dba57c47d90b77e02bfebd615","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kangax/fabric.js/pulls/2660/commits","review_comments_url":"https://api.github.com/repos/kangax/fabric.js/pulls/2660/comments","review_comment_url":"https://api.github.com/repos/kangax/fabric.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/2660/comments","statuses_url":"https://api.github.com/repos/kangax/fabric.js/statuses/a1f37fa78d8fa3ab2aee81336b2e86c0d68f3d25","head":{"label":"netheril96:event_improve","ref":"event_improve","sha":"a1f37fa78d8fa3ab2aee81336b2e86c0d68f3d25","user":{"login":"netheril96","id":836839,"avatar_url":"https://avatars.githubusercontent.com/u/836839?v=3","gravatar_id":"","url":"https://api.github.com/users/netheril96","html_url":"https://github.com/netheril96","followers_url":"https://api.github.com/users/netheril96/followers","following_url":"https://api.github.com/users/netheril96/following{/other_user}","gists_url":"https://api.github.com/users/netheril96/gists{/gist_id}","starred_url":"https://api.github.com/users/netheril96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netheril96/subscriptions","organizations_url":"https://api.github.com/users/netheril96/orgs","repos_url":"https://api.github.com/users/netheril96/repos","events_url":"https://api.github.com/users/netheril96/events{/privacy}","received_events_url":"https://api.github.com/users/netheril96/received_events","type":"User","site_admin":false},"repo":{"id":47106715,"name":"fabric.js","full_name":"netheril96/fabric.js","owner":{"login":"netheril96","id":836839,"avatar_url":"https://avatars.githubusercontent.com/u/836839?v=3","gravatar_id":"","url":"https://api.github.com/users/netheril96","html_url":"https://github.com/netheril96","followers_url":"https://api.github.com/users/netheril96/followers","following_url":"https://api.github.com/users/netheril96/following{/other_user}","gists_url":"https://api.github.com/users/netheril96/gists{/gist_id}","starred_url":"https://api.github.com/users/netheril96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netheril96/subscriptions","organizations_url":"https://api.github.com/users/netheril96/orgs","repos_url":"https://api.github.com/users/netheril96/repos","events_url":"https://api.github.com/users/netheril96/events{/privacy}","received_events_url":"https://api.github.com/users/netheril96/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/netheril96/fabric.js","description":"Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser","fork":true,"url":"https://api.github.com/repos/netheril96/fabric.js","forks_url":"https://api.github.com/repos/netheril96/fabric.js/forks","keys_url":"https://api.github.com/repos/netheril96/fabric.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netheril96/fabric.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netheril96/fabric.js/teams","hooks_url":"https://api.github.com/repos/netheril96/fabric.js/hooks","issue_events_url":"https://api.github.com/repos/netheril96/fabric.js/issues/events{/number}","events_url":"https://api.github.com/repos/netheril96/fabric.js/events","assignees_url":"https://api.github.com/repos/netheril96/fabric.js/assignees{/user}","branches_url":"https://api.github.com/repos/netheril96/fabric.js/branches{/branch}","tags_url":"https://api.github.com/repos/netheril96/fabric.js/tags","blobs_url":"https://api.github.com/repos/netheril96/fabric.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netheril96/fabric.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netheril96/fabric.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/netheril96/fabric.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netheril96/fabric.js/statuses/{sha}","languages_url":"https://api.github.com/repos/netheril96/fabric.js/languages","stargazers_url":"https://api.github.com/repos/netheril96/fabric.js/stargazers","contributors_url":"https://api.github.com/repos/netheril96/fabric.js/contributors","subscribers_url":"https://api.github.com/repos/netheril96/fabric.js/subscribers","subscription_url":"https://api.github.com/repos/netheril96/fabric.js/subscription","commits_url":"https://api.github.com/repos/netheril96/fabric.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/netheril96/fabric.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/netheril96/fabric.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/netheril96/fabric.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/netheril96/fabric.js/contents/{+path}","compare_url":"https://api.github.com/repos/netheril96/fabric.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netheril96/fabric.js/merges","archive_url":"https://api.github.com/repos/netheril96/fabric.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netheril96/fabric.js/downloads","issues_url":"https://api.github.com/repos/netheril96/fabric.js/issues{/number}","pulls_url":"https://api.github.com/repos/netheril96/fabric.js/pulls{/number}","milestones_url":"https://api.github.com/repos/netheril96/fabric.js/milestones{/number}","notifications_url":"https://api.github.com/repos/netheril96/fabric.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netheril96/fabric.js/labels{/name}","releases_url":"https://api.github.com/repos/netheril96/fabric.js/releases{/id}","created_at":"2015-11-30T08:59:38Z","updated_at":"2015-11-30T08:59:44Z","pushed_at":"2015-11-30T09:05:24Z","git_url":"git://github.com/netheril96/fabric.js.git","ssh_url":"git@github.com:netheril96/fabric.js.git","clone_url":"https://github.com/netheril96/fabric.js.git","svn_url":"https://github.com/netheril96/fabric.js","homepage":"http://fabricjs.com","size":96739,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kangax:master","ref":"master","sha":"1053a917ab89061f1c42fab11b8933c1d8b534ca","user":{"login":"kangax","id":383,"avatar_url":"https://avatars.githubusercontent.com/u/383?v=3","gravatar_id":"","url":"https://api.github.com/users/kangax","html_url":"https://github.com/kangax","followers_url":"https://api.github.com/users/kangax/followers","following_url":"https://api.github.com/users/kangax/following{/other_user}","gists_url":"https://api.github.com/users/kangax/gists{/gist_id}","starred_url":"https://api.github.com/users/kangax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangax/subscriptions","organizations_url":"https://api.github.com/users/kangax/orgs","repos_url":"https://api.github.com/users/kangax/repos","events_url":"https://api.github.com/users/kangax/events{/privacy}","received_events_url":"https://api.github.com/users/kangax/received_events","type":"User","site_admin":false},"repo":{"id":712530,"name":"fabric.js","full_name":"kangax/fabric.js","owner":{"login":"kangax","id":383,"avatar_url":"https://avatars.githubusercontent.com/u/383?v=3","gravatar_id":"","url":"https://api.github.com/users/kangax","html_url":"https://github.com/kangax","followers_url":"https://api.github.com/users/kangax/followers","following_url":"https://api.github.com/users/kangax/following{/other_user}","gists_url":"https://api.github.com/users/kangax/gists{/gist_id}","starred_url":"https://api.github.com/users/kangax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kangax/subscriptions","organizations_url":"https://api.github.com/users/kangax/orgs","repos_url":"https://api.github.com/users/kangax/repos","events_url":"https://api.github.com/users/kangax/events{/privacy}","received_events_url":"https://api.github.com/users/kangax/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kangax/fabric.js","description":"Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser","fork":false,"url":"https://api.github.com/repos/kangax/fabric.js","forks_url":"https://api.github.com/repos/kangax/fabric.js/forks","keys_url":"https://api.github.com/repos/kangax/fabric.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kangax/fabric.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kangax/fabric.js/teams","hooks_url":"https://api.github.com/repos/kangax/fabric.js/hooks","issue_events_url":"https://api.github.com/repos/kangax/fabric.js/issues/events{/number}","events_url":"https://api.github.com/repos/kangax/fabric.js/events","assignees_url":"https://api.github.com/repos/kangax/fabric.js/assignees{/user}","branches_url":"https://api.github.com/repos/kangax/fabric.js/branches{/branch}","tags_url":"https://api.github.com/repos/kangax/fabric.js/tags","blobs_url":"https://api.github.com/repos/kangax/fabric.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kangax/fabric.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kangax/fabric.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/kangax/fabric.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kangax/fabric.js/statuses/{sha}","languages_url":"https://api.github.com/repos/kangax/fabric.js/languages","stargazers_url":"https://api.github.com/repos/kangax/fabric.js/stargazers","contributors_url":"https://api.github.com/repos/kangax/fabric.js/contributors","subscribers_url":"https://api.github.com/repos/kangax/fabric.js/subscribers","subscription_url":"https://api.github.com/repos/kangax/fabric.js/subscription","commits_url":"https://api.github.com/repos/kangax/fabric.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/kangax/fabric.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/kangax/fabric.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/kangax/fabric.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/kangax/fabric.js/contents/{+path}","compare_url":"https://api.github.com/repos/kangax/fabric.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kangax/fabric.js/merges","archive_url":"https://api.github.com/repos/kangax/fabric.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kangax/fabric.js/downloads","issues_url":"https://api.github.com/repos/kangax/fabric.js/issues{/number}","pulls_url":"https://api.github.com/repos/kangax/fabric.js/pulls{/number}","milestones_url":"https://api.github.com/repos/kangax/fabric.js/milestones{/number}","notifications_url":"https://api.github.com/repos/kangax/fabric.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kangax/fabric.js/labels{/name}","releases_url":"https://api.github.com/repos/kangax/fabric.js/releases{/id}","created_at":"2010-06-09T22:24:38Z","updated_at":"2015-11-30T08:59:34Z","pushed_at":"2015-11-30T09:35:20Z","git_url":"git://github.com/kangax/fabric.js.git","ssh_url":"git@github.com:kangax/fabric.js.git","clone_url":"https://github.com/kangax/fabric.js.git","svn_url":"https://github.com/kangax/fabric.js","homepage":"http://fabricjs.com","size":107526,"stargazers_count":5137,"watchers_count":5137,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":890,"mirror_url":null,"open_issues_count":297,"forks":890,"open_issues":297,"watchers":5137,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2660"},"html":{"href":"https://github.com/kangax/fabric.js/pull/2660"},"issue":{"href":"https://api.github.com/repos/kangax/fabric.js/issues/2660"},"comments":{"href":"https://api.github.com/repos/kangax/fabric.js/issues/2660/comments"},"review_comments":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2660/comments"},"review_comment":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kangax/fabric.js/pulls/2660/commits"},"statuses":{"href":"https://api.github.com/repos/kangax/fabric.js/statuses/a1f37fa78d8fa3ab2aee81336b2e86c0d68f3d25"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":10229,"deletions":29939,"changed_files":6}}