{"action":"created","comment":{"url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/comments/56513913","id":56513913,"diff_hunk":"@@ -0,0 +1,56 @@\n+import Mn from 'backbone.marionette';\n+import application from '../application';\n+import Tracks from '../collections/tracks';\n+\n+const Header = Mn.ItemView.extend({\n+\n+    template: require('./templates/header'),\n+\n+    events: {\n+        'click #reset-upnext': 'resetUpNext',\n+        'click #delete-playlist': 'deletePlaylist'\n+    },\n+\n+    modelEvents: { \"change:currentPlaylist\": 'changedPlaylist' },\n+\n+    initialize() {\n+       this.listenTo(\n+            this.model.get('currentPlaylist').get('tracks'),\n+            'update reset',\n+            this.render\n+        );\n+   },\n+\n+    serializeData() {\n+        let currentPlaylist = this.model.get('currentPlaylist');\n+        return {\n+            title: currentPlaylist.get('title'),\n+            count: currentPlaylist.get('tracks').length\n+        }\n+    },\n+\n+    changedPlaylist(model, newValue) {\n+        this.stopListening(model.changed.currentPlaylist);\n+        this.listenTo(\n+            this.model.get('currentPlaylist').get('tracks'),\n+            'update reset',\n+            this.render\n+        );\n+        this.render();\n+    },\n+\n+    deletePlaylist() {","path":"app/views/header.js","position":42,"original_position":42,"commit_id":"0f7778a6c56d07a211d8addd90d2df99641c657d","original_commit_id":"0f7778a6c56d07a211d8addd90d2df99641c657d","user":{"login":"m4dz","id":471486,"avatar_url":"https://avatars.githubusercontent.com/u/471486?v=3","gravatar_id":"","url":"https://api.github.com/users/m4dz","html_url":"https://github.com/m4dz","followers_url":"https://api.github.com/users/m4dz/followers","following_url":"https://api.github.com/users/m4dz/following{/other_user}","gists_url":"https://api.github.com/users/m4dz/gists{/gist_id}","starred_url":"https://api.github.com/users/m4dz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m4dz/subscriptions","organizations_url":"https://api.github.com/users/m4dz/orgs","repos_url":"https://api.github.com/users/m4dz/repos","events_url":"https://api.github.com/users/m4dz/events{/privacy}","received_events_url":"https://api.github.com/users/m4dz/received_events","type":"User","site_admin":false},"body":"Ok, that's what I understood. I think it's not the reponsability of the `header` view to do it. I suggest it trigger a `request` in the app.channel, and the `allPlaylists` collection listen to this event to delete itself the element. I loose the coupling and let us add other methods to do the same thing later (e.g. a trash button that appear when hovering the playlist name in the drawer).","created_at":"2016-03-17T14:37:17Z","updated_at":"2016-03-17T14:37:17Z","html_url":"https://github.com/cozy-labs/cozy-music/pull/3#discussion_r56513913","pull_request_url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/comments/56513913"},"html":{"href":"https://github.com/cozy-labs/cozy-music/pull/3#discussion_r56513913"},"pull_request":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3","id":62588539,"html_url":"https://github.com/cozy-labs/cozy-music/pull/3","diff_url":"https://github.com/cozy-labs/cozy-music/pull/3.diff","patch_url":"https://github.com/cozy-labs/cozy-music/pull/3.patch","issue_url":"https://api.github.com/repos/cozy-labs/cozy-music/issues/3","number":3,"state":"open","locked":false,"title":"Review Pull Request","user":{"login":"flyingrub","id":3988628,"avatar_url":"https://avatars.githubusercontent.com/u/3988628?v=3","gravatar_id":"","url":"https://api.github.com/users/flyingrub","html_url":"https://github.com/flyingrub","followers_url":"https://api.github.com/users/flyingrub/followers","following_url":"https://api.github.com/users/flyingrub/following{/other_user}","gists_url":"https://api.github.com/users/flyingrub/gists{/gist_id}","starred_url":"https://api.github.com/users/flyingrub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyingrub/subscriptions","organizations_url":"https://api.github.com/users/flyingrub/orgs","repos_url":"https://api.github.com/users/flyingrub/repos","events_url":"https://api.github.com/users/flyingrub/events{/privacy}","received_events_url":"https://api.github.com/users/flyingrub/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-11T19:13:24Z","updated_at":"2016-03-17T14:37:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35d32510bcd2d7beb231dc67e140bee5fb481ff7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3/commits","review_comments_url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3/comments","review_comment_url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cozy-labs/cozy-music/issues/3/comments","statuses_url":"https://api.github.com/repos/cozy-labs/cozy-music/statuses/0f7778a6c56d07a211d8addd90d2df99641c657d","head":{"label":"flyingrub:v2-sdk","ref":"v2-sdk","sha":"0f7778a6c56d07a211d8addd90d2df99641c657d","user":{"login":"flyingrub","id":3988628,"avatar_url":"https://avatars.githubusercontent.com/u/3988628?v=3","gravatar_id":"","url":"https://api.github.com/users/flyingrub","html_url":"https://github.com/flyingrub","followers_url":"https://api.github.com/users/flyingrub/followers","following_url":"https://api.github.com/users/flyingrub/following{/other_user}","gists_url":"https://api.github.com/users/flyingrub/gists{/gist_id}","starred_url":"https://api.github.com/users/flyingrub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyingrub/subscriptions","organizations_url":"https://api.github.com/users/flyingrub/orgs","repos_url":"https://api.github.com/users/flyingrub/repos","events_url":"https://api.github.com/users/flyingrub/events{/privacy}","received_events_url":"https://api.github.com/users/flyingrub/received_events","type":"User","site_admin":false},"repo":{"id":52876612,"name":"cozy-music","full_name":"flyingrub/cozy-music","owner":{"login":"flyingrub","id":3988628,"avatar_url":"https://avatars.githubusercontent.com/u/3988628?v=3","gravatar_id":"","url":"https://api.github.com/users/flyingrub","html_url":"https://github.com/flyingrub","followers_url":"https://api.github.com/users/flyingrub/followers","following_url":"https://api.github.com/users/flyingrub/following{/other_user}","gists_url":"https://api.github.com/users/flyingrub/gists{/gist_id}","starred_url":"https://api.github.com/users/flyingrub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyingrub/subscriptions","organizations_url":"https://api.github.com/users/flyingrub/orgs","repos_url":"https://api.github.com/users/flyingrub/repos","events_url":"https://api.github.com/users/flyingrub/events{/privacy}","received_events_url":"https://api.github.com/users/flyingrub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flyingrub/cozy-music","description":"Cozic, an open source music cloud","fork":true,"url":"https://api.github.com/repos/flyingrub/cozy-music","forks_url":"https://api.github.com/repos/flyingrub/cozy-music/forks","keys_url":"https://api.github.com/repos/flyingrub/cozy-music/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flyingrub/cozy-music/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flyingrub/cozy-music/teams","hooks_url":"https://api.github.com/repos/flyingrub/cozy-music/hooks","issue_events_url":"https://api.github.com/repos/flyingrub/cozy-music/issues/events{/number}","events_url":"https://api.github.com/repos/flyingrub/cozy-music/events","assignees_url":"https://api.github.com/repos/flyingrub/cozy-music/assignees{/user}","branches_url":"https://api.github.com/repos/flyingrub/cozy-music/branches{/branch}","tags_url":"https://api.github.com/repos/flyingrub/cozy-music/tags","blobs_url":"https://api.github.com/repos/flyingrub/cozy-music/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flyingrub/cozy-music/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flyingrub/cozy-music/git/refs{/sha}","trees_url":"https://api.github.com/repos/flyingrub/cozy-music/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flyingrub/cozy-music/statuses/{sha}","languages_url":"https://api.github.com/repos/flyingrub/cozy-music/languages","stargazers_url":"https://api.github.com/repos/flyingrub/cozy-music/stargazers","contributors_url":"https://api.github.com/repos/flyingrub/cozy-music/contributors","subscribers_url":"https://api.github.com/repos/flyingrub/cozy-music/subscribers","subscription_url":"https://api.github.com/repos/flyingrub/cozy-music/subscription","commits_url":"https://api.github.com/repos/flyingrub/cozy-music/commits{/sha}","git_commits_url":"https://api.github.com/repos/flyingrub/cozy-music/git/commits{/sha}","comments_url":"https://api.github.com/repos/flyingrub/cozy-music/comments{/number}","issue_comment_url":"https://api.github.com/repos/flyingrub/cozy-music/issues/comments{/number}","contents_url":"https://api.github.com/repos/flyingrub/cozy-music/contents/{+path}","compare_url":"https://api.github.com/repos/flyingrub/cozy-music/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flyingrub/cozy-music/merges","archive_url":"https://api.github.com/repos/flyingrub/cozy-music/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flyingrub/cozy-music/downloads","issues_url":"https://api.github.com/repos/flyingrub/cozy-music/issues{/number}","pulls_url":"https://api.github.com/repos/flyingrub/cozy-music/pulls{/number}","milestones_url":"https://api.github.com/repos/flyingrub/cozy-music/milestones{/number}","notifications_url":"https://api.github.com/repos/flyingrub/cozy-music/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flyingrub/cozy-music/labels{/name}","releases_url":"https://api.github.com/repos/flyingrub/cozy-music/releases{/id}","deployments_url":"https://api.github.com/repos/flyingrub/cozy-music/deployments","created_at":"2016-03-01T12:53:52Z","updated_at":"2016-03-01T23:33:09Z","pushed_at":"2016-03-17T01:21:49Z","git_url":"git://github.com/flyingrub/cozy-music.git","ssh_url":"git@github.com:flyingrub/cozy-music.git","clone_url":"https://github.com/flyingrub/cozy-music.git","svn_url":"https://github.com/flyingrub/cozy-music","homepage":"","size":26700,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"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":"v2-sdk"}},"base":{"label":"cozy-labs:v2-sdk","ref":"v2-sdk","sha":"561af2f0b62b34576db72b0259bd94d5d7663189","user":{"login":"cozy-labs","id":8415593,"avatar_url":"https://avatars.githubusercontent.com/u/8415593?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy-labs","html_url":"https://github.com/cozy-labs","followers_url":"https://api.github.com/users/cozy-labs/followers","following_url":"https://api.github.com/users/cozy-labs/following{/other_user}","gists_url":"https://api.github.com/users/cozy-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy-labs/subscriptions","organizations_url":"https://api.github.com/users/cozy-labs/orgs","repos_url":"https://api.github.com/users/cozy-labs/repos","events_url":"https://api.github.com/users/cozy-labs/events{/privacy}","received_events_url":"https://api.github.com/users/cozy-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":51302234,"name":"cozy-music","full_name":"cozy-labs/cozy-music","owner":{"login":"cozy-labs","id":8415593,"avatar_url":"https://avatars.githubusercontent.com/u/8415593?v=3","gravatar_id":"","url":"https://api.github.com/users/cozy-labs","html_url":"https://github.com/cozy-labs","followers_url":"https://api.github.com/users/cozy-labs/followers","following_url":"https://api.github.com/users/cozy-labs/following{/other_user}","gists_url":"https://api.github.com/users/cozy-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/cozy-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cozy-labs/subscriptions","organizations_url":"https://api.github.com/users/cozy-labs/orgs","repos_url":"https://api.github.com/users/cozy-labs/repos","events_url":"https://api.github.com/users/cozy-labs/events{/privacy}","received_events_url":"https://api.github.com/users/cozy-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cozy-labs/cozy-music","description":"Cozic, an open source music cloud","fork":true,"url":"https://api.github.com/repos/cozy-labs/cozy-music","forks_url":"https://api.github.com/repos/cozy-labs/cozy-music/forks","keys_url":"https://api.github.com/repos/cozy-labs/cozy-music/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cozy-labs/cozy-music/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cozy-labs/cozy-music/teams","hooks_url":"https://api.github.com/repos/cozy-labs/cozy-music/hooks","issue_events_url":"https://api.github.com/repos/cozy-labs/cozy-music/issues/events{/number}","events_url":"https://api.github.com/repos/cozy-labs/cozy-music/events","assignees_url":"https://api.github.com/repos/cozy-labs/cozy-music/assignees{/user}","branches_url":"https://api.github.com/repos/cozy-labs/cozy-music/branches{/branch}","tags_url":"https://api.github.com/repos/cozy-labs/cozy-music/tags","blobs_url":"https://api.github.com/repos/cozy-labs/cozy-music/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cozy-labs/cozy-music/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cozy-labs/cozy-music/git/refs{/sha}","trees_url":"https://api.github.com/repos/cozy-labs/cozy-music/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cozy-labs/cozy-music/statuses/{sha}","languages_url":"https://api.github.com/repos/cozy-labs/cozy-music/languages","stargazers_url":"https://api.github.com/repos/cozy-labs/cozy-music/stargazers","contributors_url":"https://api.github.com/repos/cozy-labs/cozy-music/contributors","subscribers_url":"https://api.github.com/repos/cozy-labs/cozy-music/subscribers","subscription_url":"https://api.github.com/repos/cozy-labs/cozy-music/subscription","commits_url":"https://api.github.com/repos/cozy-labs/cozy-music/commits{/sha}","git_commits_url":"https://api.github.com/repos/cozy-labs/cozy-music/git/commits{/sha}","comments_url":"https://api.github.com/repos/cozy-labs/cozy-music/comments{/number}","issue_comment_url":"https://api.github.com/repos/cozy-labs/cozy-music/issues/comments{/number}","contents_url":"https://api.github.com/repos/cozy-labs/cozy-music/contents/{+path}","compare_url":"https://api.github.com/repos/cozy-labs/cozy-music/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cozy-labs/cozy-music/merges","archive_url":"https://api.github.com/repos/cozy-labs/cozy-music/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cozy-labs/cozy-music/downloads","issues_url":"https://api.github.com/repos/cozy-labs/cozy-music/issues{/number}","pulls_url":"https://api.github.com/repos/cozy-labs/cozy-music/pulls{/number}","milestones_url":"https://api.github.com/repos/cozy-labs/cozy-music/milestones{/number}","notifications_url":"https://api.github.com/repos/cozy-labs/cozy-music/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cozy-labs/cozy-music/labels{/name}","releases_url":"https://api.github.com/repos/cozy-labs/cozy-music/releases{/id}","deployments_url":"https://api.github.com/repos/cozy-labs/cozy-music/deployments","created_at":"2016-02-08T14:22:48Z","updated_at":"2016-02-26T15:46:59Z","pushed_at":"2016-03-17T01:21:50Z","git_url":"git://github.com/cozy-labs/cozy-music.git","ssh_url":"git@github.com:cozy-labs/cozy-music.git","clone_url":"https://github.com/cozy-labs/cozy-music.git","svn_url":"https://github.com/cozy-labs/cozy-music","homepage":"","size":26815,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"v2-sdk"}},"_links":{"self":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3"},"html":{"href":"https://github.com/cozy-labs/cozy-music/pull/3"},"issue":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/issues/3"},"comments":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/cozy-labs/cozy-music/statuses/0f7778a6c56d07a211d8addd90d2df99641c657d"}}}}