{"action":"created","comment":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/62156300","id":62156300,"diff_hunk":"@@ -320,6 +320,18 @@ var Button = cc.Class({\n         }\n     },\n \n+    onEnable: function () {\n+        if (CC_EDITOR) {\n+            if(this.node) {\n+                this.node.on('spriteframe-changed', function(event) {\n+                    if (this.transition === Transition.SPRITE) {\n+                        this.normalSprite = event.detail.spriteFrame;\n+                    }\n+                }.bind(this));","path":"cocos2d/core/components/CCButton.js","position":11,"original_position":11,"commit_id":"7c6a25fe2f26b2ca138d31aaae83fac994600d4a","original_commit_id":"7c6a25fe2f26b2ca138d31aaae83fac994600d4a","user":{"login":"jareguo","id":1503156,"avatar_url":"https://avatars.githubusercontent.com/u/1503156?v=3","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"body":"bind 的性能很低，不建议用在 Button 这样常用的组件上","created_at":"2016-05-05T07:36:48Z","updated_at":"2016-05-05T07:36:48Z","html_url":"https://github.com/cocos-creator/engine/pull/644#discussion_r62156300","pull_request_url":"https://api.github.com/repos/cocos-creator/engine/pulls/644","_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/62156300"},"html":{"href":"https://github.com/cocos-creator/engine/pull/644#discussion_r62156300"},"pull_request":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/644"}}},"pull_request":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/644","id":68974972,"html_url":"https://github.com/cocos-creator/engine/pull/644","diff_url":"https://github.com/cocos-creator/engine/pull/644.diff","patch_url":"https://github.com/cocos-creator/engine/pull/644.patch","issue_url":"https://api.github.com/repos/cocos-creator/engine/issues/644","number":644,"state":"open","locked":false,"title":"fix button target spriteframe change issue","user":{"login":"zilongshanren","id":785541,"avatar_url":"https://avatars.githubusercontent.com/u/785541?v=3","gravatar_id":"","url":"https://api.github.com/users/zilongshanren","html_url":"https://github.com/zilongshanren","followers_url":"https://api.github.com/users/zilongshanren/followers","following_url":"https://api.github.com/users/zilongshanren/following{/other_user}","gists_url":"https://api.github.com/users/zilongshanren/gists{/gist_id}","starred_url":"https://api.github.com/users/zilongshanren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilongshanren/subscriptions","organizations_url":"https://api.github.com/users/zilongshanren/orgs","repos_url":"https://api.github.com/users/zilongshanren/repos","events_url":"https://api.github.com/users/zilongshanren/events{/privacy}","received_events_url":"https://api.github.com/users/zilongshanren/received_events","type":"User","site_admin":false},"body":"\r\n\r\nRe: cocos-creator/fireball#2712\r\n\r\nChanges proposed in this pull request:\r\n- fix button normalSprite not updated when change target's spriteframe in Editor.\r\n\r\n@cocos-creator/engine-admins","created_at":"2016-05-05T07:31:17Z","updated_at":"2016-05-05T07:36:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b391ebdaa7f6ae0aa529291ee501e99a9c65168e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cocos-creator/engine/pulls/644/commits","review_comments_url":"https://api.github.com/repos/cocos-creator/engine/pulls/644/comments","review_comment_url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cocos-creator/engine/issues/644/comments","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/7c6a25fe2f26b2ca138d31aaae83fac994600d4a","head":{"label":"zilongshanren:improve-button-normal-spriteframe","ref":"improve-button-normal-spriteframe","sha":"7c6a25fe2f26b2ca138d31aaae83fac994600d4a","user":{"login":"zilongshanren","id":785541,"avatar_url":"https://avatars.githubusercontent.com/u/785541?v=3","gravatar_id":"","url":"https://api.github.com/users/zilongshanren","html_url":"https://github.com/zilongshanren","followers_url":"https://api.github.com/users/zilongshanren/followers","following_url":"https://api.github.com/users/zilongshanren/following{/other_user}","gists_url":"https://api.github.com/users/zilongshanren/gists{/gist_id}","starred_url":"https://api.github.com/users/zilongshanren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilongshanren/subscriptions","organizations_url":"https://api.github.com/users/zilongshanren/orgs","repos_url":"https://api.github.com/users/zilongshanren/repos","events_url":"https://api.github.com/users/zilongshanren/events{/privacy}","received_events_url":"https://api.github.com/users/zilongshanren/received_events","type":"User","site_admin":false},"repo":{"id":54608207,"name":"engine","full_name":"zilongshanren/engine","owner":{"login":"zilongshanren","id":785541,"avatar_url":"https://avatars.githubusercontent.com/u/785541?v=3","gravatar_id":"","url":"https://api.github.com/users/zilongshanren","html_url":"https://github.com/zilongshanren","followers_url":"https://api.github.com/users/zilongshanren/followers","following_url":"https://api.github.com/users/zilongshanren/following{/other_user}","gists_url":"https://api.github.com/users/zilongshanren/gists{/gist_id}","starred_url":"https://api.github.com/users/zilongshanren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilongshanren/subscriptions","organizations_url":"https://api.github.com/users/zilongshanren/orgs","repos_url":"https://api.github.com/users/zilongshanren/repos","events_url":"https://api.github.com/users/zilongshanren/events{/privacy}","received_events_url":"https://api.github.com/users/zilongshanren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zilongshanren/engine","description":"The engine for Cocos Creator","fork":true,"url":"https://api.github.com/repos/zilongshanren/engine","forks_url":"https://api.github.com/repos/zilongshanren/engine/forks","keys_url":"https://api.github.com/repos/zilongshanren/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zilongshanren/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zilongshanren/engine/teams","hooks_url":"https://api.github.com/repos/zilongshanren/engine/hooks","issue_events_url":"https://api.github.com/repos/zilongshanren/engine/issues/events{/number}","events_url":"https://api.github.com/repos/zilongshanren/engine/events","assignees_url":"https://api.github.com/repos/zilongshanren/engine/assignees{/user}","branches_url":"https://api.github.com/repos/zilongshanren/engine/branches{/branch}","tags_url":"https://api.github.com/repos/zilongshanren/engine/tags","blobs_url":"https://api.github.com/repos/zilongshanren/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zilongshanren/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zilongshanren/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/zilongshanren/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zilongshanren/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/zilongshanren/engine/languages","stargazers_url":"https://api.github.com/repos/zilongshanren/engine/stargazers","contributors_url":"https://api.github.com/repos/zilongshanren/engine/contributors","subscribers_url":"https://api.github.com/repos/zilongshanren/engine/subscribers","subscription_url":"https://api.github.com/repos/zilongshanren/engine/subscription","commits_url":"https://api.github.com/repos/zilongshanren/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/zilongshanren/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/zilongshanren/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/zilongshanren/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/zilongshanren/engine/contents/{+path}","compare_url":"https://api.github.com/repos/zilongshanren/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zilongshanren/engine/merges","archive_url":"https://api.github.com/repos/zilongshanren/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zilongshanren/engine/downloads","issues_url":"https://api.github.com/repos/zilongshanren/engine/issues{/number}","pulls_url":"https://api.github.com/repos/zilongshanren/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/zilongshanren/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/zilongshanren/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zilongshanren/engine/labels{/name}","releases_url":"https://api.github.com/repos/zilongshanren/engine/releases{/id}","deployments_url":"https://api.github.com/repos/zilongshanren/engine/deployments","created_at":"2016-03-24T02:22:57Z","updated_at":"2016-03-24T02:23:01Z","pushed_at":"2016-05-05T07:30:22Z","git_url":"git://github.com/zilongshanren/engine.git","ssh_url":"git@github.com:zilongshanren/engine.git","clone_url":"https://github.com/zilongshanren/engine.git","svn_url":"https://github.com/zilongshanren/engine","homepage":"http://www.cocos2d-x.org/creator","size":23495,"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":"cocos-creator:v1.0","ref":"v1.0","sha":"7d62a0790558b1855b91c580dcd29ef188aa0bf5","user":{"login":"cocos-creator","id":6937061,"avatar_url":"https://avatars.githubusercontent.com/u/6937061?v=3","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"repo":{"id":47440536,"name":"engine","full_name":"cocos-creator/engine","owner":{"login":"cocos-creator","id":6937061,"avatar_url":"https://avatars.githubusercontent.com/u/6937061?v=3","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cocos-creator/engine","description":"The engine for Cocos Creator","fork":false,"url":"https://api.github.com/repos/cocos-creator/engine","forks_url":"https://api.github.com/repos/cocos-creator/engine/forks","keys_url":"https://api.github.com/repos/cocos-creator/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cocos-creator/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cocos-creator/engine/teams","hooks_url":"https://api.github.com/repos/cocos-creator/engine/hooks","issue_events_url":"https://api.github.com/repos/cocos-creator/engine/issues/events{/number}","events_url":"https://api.github.com/repos/cocos-creator/engine/events","assignees_url":"https://api.github.com/repos/cocos-creator/engine/assignees{/user}","branches_url":"https://api.github.com/repos/cocos-creator/engine/branches{/branch}","tags_url":"https://api.github.com/repos/cocos-creator/engine/tags","blobs_url":"https://api.github.com/repos/cocos-creator/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cocos-creator/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cocos-creator/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cocos-creator/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cocos-creator/engine/languages","stargazers_url":"https://api.github.com/repos/cocos-creator/engine/stargazers","contributors_url":"https://api.github.com/repos/cocos-creator/engine/contributors","subscribers_url":"https://api.github.com/repos/cocos-creator/engine/subscribers","subscription_url":"https://api.github.com/repos/cocos-creator/engine/subscription","commits_url":"https://api.github.com/repos/cocos-creator/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cocos-creator/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cocos-creator/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cocos-creator/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cocos-creator/engine/contents/{+path}","compare_url":"https://api.github.com/repos/cocos-creator/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cocos-creator/engine/merges","archive_url":"https://api.github.com/repos/cocos-creator/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cocos-creator/engine/downloads","issues_url":"https://api.github.com/repos/cocos-creator/engine/issues{/number}","pulls_url":"https://api.github.com/repos/cocos-creator/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cocos-creator/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cocos-creator/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cocos-creator/engine/labels{/name}","releases_url":"https://api.github.com/repos/cocos-creator/engine/releases{/id}","deployments_url":"https://api.github.com/repos/cocos-creator/engine/deployments","created_at":"2015-12-05T03:28:59Z","updated_at":"2016-05-04T12:48:57Z","pushed_at":"2016-05-05T07:31:18Z","git_url":"git://github.com/cocos-creator/engine.git","ssh_url":"git@github.com:cocos-creator/engine.git","clone_url":"https://github.com/cocos-creator/engine.git","svn_url":"https://github.com/cocos-creator/engine","homepage":"http://www.cocos2d-x.org/creator","size":24219,"stargazers_count":50,"watchers_count":50,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":10,"forks":23,"open_issues":10,"watchers":50,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/644"},"html":{"href":"https://github.com/cocos-creator/engine/pull/644"},"issue":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/644"},"comments":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/644/comments"},"review_comments":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/644/comments"},"review_comment":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/644/commits"},"statuses":{"href":"https://api.github.com/repos/cocos-creator/engine/statuses/7c6a25fe2f26b2ca138d31aaae83fac994600d4a"}}}}