{"action":"created","comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/25119125","id":25119125,"diff_hunk":"@@ -102,6 +103,64 @@ new Marionette.LayoutView({\n })\n ```\n \n+### LayoutView childEvents\n+\n+You can specify a `childEvents` hash or method which allows you to capture all bubbling `childEvents` without having to manually set bindings. The keys of the hash can either be a function or a string that is the name of a method on the layout view.\n+\n+```js\n+// childEvents can be specified as a hash...\n+var MyLayoutView = Marionette.LayoutView.extend({\n+\n+  // This callback will be called whenever a child is rendered or emits a `render` event\n+  childEvents: {\n+    render: function() {\n+      console.log(\"a childView has been rendered\");\n+    }\n+  }\n+});\n+\n+// ...or as a function that returns a hash.\n+var MyLayoutView = Marionette.LayoutView.extend({\n+\n+  childEvents: function() {\n+    return {\n+      render: this.onChildRendered\n+    }\n+  });\n+  ```\n+\n+  This also works for custom events that you might fire on your child views.\n+\n+  ```js\n+  // The child view fires a custom event, `show:message`\n+  var ChildView = new Marionette.ItemView.extend({\n+    events: {\n+      'click .button': 'showMessage'\n+    },\n+\n+    showMessage: function () {","path":"docs/marionette.layoutview.md","position":null,"original_position":47,"commit_id":"f4524f8762224387b5880fb412c064af000995af","original_commit_id":"8fecbe566c2c2cf34f06f5d72fc7fab696f7ed96","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"body":"got em\r\n","created_at":"2015-02-21T04:13:18Z","updated_at":"2015-02-21T04:13:18Z","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2316#discussion_r25119125","pull_request_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316","_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/25119125"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2316#discussion_r25119125"},"pull_request":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316"}}},"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316","id":29110650,"html_url":"https://github.com/marionettejs/backbone.marionette/pull/2316","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/2316.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/2316.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2316","number":2316,"state":"open","locked":false,"title":"Add child events for layout children views","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"body":"Region events are one of the most common requets we've received:\r\nevents in a layout like you can listen for child events in a collection\r\nview.\r\n\r\n```js\r\nLayoutView.extend({\r\n\r\n  childEvents: {\r\n    'submit': 'onChildViewSubmit'\r\n    'fail': 'onChildViewFail'\r\n  },\r\n\r\n  onChildViewSubmit: function(childView, successMsg) {},\r\n  onChildViewFail: function(childView, failMsg) {}\r\n})\r\n```\r\n\r\n### Workarounds:\r\nThe first is share a radio channel,\r\nthe second is share a common eventable object (think model). Messaging\r\nthrough a channel can be ugly because it encourages an explosion of\r\nchannels that can be hard to keep track of. Think lots of little wires\r\nthrough the app. Messaging through a shared eventable object, is ugly\r\nbecause it's a source of indirection that's unexpected. It's not obvious\r\nthat the model is being used in this way.\r\n\r\n### Event Bubbling:\r\nThis is not event bubbling where an event will go all the way up the\r\nview tree. I do not want to rule that out, as it might be nice, but\r\nthere are more design considerations there.\r\n\r\n### Utility Methods\r\nWhen we introduced the `_parent` reference, we discussed that there was\r\nsupport for getting nested children for proxying events, but there was\r\nno support for getting ancestor views for proxying events and other\r\ninternal utilities. We now have support for this, but will obviously\r\ndiscourage end users from tapping into the power. With great power\r\ncomes...\r\n\r\n### Docs\r\nI'll add them when the time comes \r\n\r\n\r\n### Major\r\nThis should be mostly trivial to get onto major. There's one ref to LayoutView, but besides that everything should be fine","created_at":"2015-02-11T17:27:34Z","updated_at":"2015-02-21T04:13:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"595fe625491b395487627d22efc9a7f8b8354cea","assignee":null,"milestone":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones/27","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones/27/labels","id":887374,"number":27,"title":"v2.4","description":"","creator":{"login":"jmeas","id":2322305,"avatar_url":"https://avatars.githubusercontent.com/u/2322305?v=3","gravatar_id":"","url":"https://api.github.com/users/jmeas","html_url":"https://github.com/jmeas","followers_url":"https://api.github.com/users/jmeas/followers","following_url":"https://api.github.com/users/jmeas/following{/other_user}","gists_url":"https://api.github.com/users/jmeas/gists{/gist_id}","starred_url":"https://api.github.com/users/jmeas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmeas/subscriptions","organizations_url":"https://api.github.com/users/jmeas/orgs","repos_url":"https://api.github.com/users/jmeas/repos","events_url":"https://api.github.com/users/jmeas/events{/privacy}","received_events_url":"https://api.github.com/users/jmeas/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":29,"state":"open","created_at":"2014-12-02T04:21:27Z","updated_at":"2015-02-21T00:22:11Z","due_on":"2015-01-09T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316/comments","review_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/{number}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2316/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/f4524f8762224387b5880fb412c064af000995af","head":{"label":"jasonLaster:region-events","ref":"region-events","sha":"f4524f8762224387b5880fb412c064af000995af","user":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"repo":{"id":15516790,"name":"backbone.marionette","full_name":"jasonLaster/backbone.marionette","owner":{"login":"jasonLaster","id":254562,"avatar_url":"https://avatars.githubusercontent.com/u/254562?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonLaster","html_url":"https://github.com/jasonLaster","followers_url":"https://api.github.com/users/jasonLaster/followers","following_url":"https://api.github.com/users/jasonLaster/following{/other_user}","gists_url":"https://api.github.com/users/jasonLaster/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonLaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonLaster/subscriptions","organizations_url":"https://api.github.com/users/jasonLaster/orgs","repos_url":"https://api.github.com/users/jasonLaster/repos","events_url":"https://api.github.com/users/jasonLaster/events{/privacy}","received_events_url":"https://api.github.com/users/jasonLaster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasonLaster/backbone.marionette","description":"Make your Backbone.js apps dance with a composite application architecture!","fork":true,"url":"https://api.github.com/repos/jasonLaster/backbone.marionette","forks_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/forks","keys_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/events","assignees_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/issues/comments/{number}","contents_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/merges","archive_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/jasonLaster/backbone.marionette/releases{/id}","created_at":"2013-12-29T23:35:16Z","updated_at":"2014-06-24T03:11:56Z","pushed_at":"2015-02-21T04:13:13Z","git_url":"git://github.com/jasonLaster/backbone.marionette.git","ssh_url":"git@github.com:jasonLaster/backbone.marionette.git","clone_url":"https://github.com/jasonLaster/backbone.marionette.git","svn_url":"https://github.com/jasonLaster/backbone.marionette","homepage":"http://marionettejs.com","size":11148,"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":"marionettejs:minor","ref":"minor","sha":"75e2a15bf20c3a288c1856885caa0aa8487aaf98","user":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"repo":{"id":2965621,"name":"backbone.marionette","full_name":"marionettejs/backbone.marionette","owner":{"login":"marionettejs","id":2273169,"avatar_url":"https://avatars.githubusercontent.com/u/2273169?v=3","gravatar_id":"","url":"https://api.github.com/users/marionettejs","html_url":"https://github.com/marionettejs","followers_url":"https://api.github.com/users/marionettejs/followers","following_url":"https://api.github.com/users/marionettejs/following{/other_user}","gists_url":"https://api.github.com/users/marionettejs/gists{/gist_id}","starred_url":"https://api.github.com/users/marionettejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionettejs/subscriptions","organizations_url":"https://api.github.com/users/marionettejs/orgs","repos_url":"https://api.github.com/users/marionettejs/repos","events_url":"https://api.github.com/users/marionettejs/events{/privacy}","received_events_url":"https://api.github.com/users/marionettejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marionettejs/backbone.marionette","description":"The Backbone Framework","fork":false,"url":"https://api.github.com/repos/marionettejs/backbone.marionette","forks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/forks","keys_url":"https://api.github.com/repos/marionettejs/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marionettejs/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marionettejs/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/marionettejs/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/marionettejs/backbone.marionette/events","assignees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/marionettejs/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/marionettejs/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/marionettejs/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/comments/{number}","contents_url":"https://api.github.com/repos/marionettejs/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/marionettejs/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marionettejs/backbone.marionette/merges","archive_url":"https://api.github.com/repos/marionettejs/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marionettejs/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/marionettejs/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/marionettejs/backbone.marionette/releases{/id}","created_at":"2011-12-12T16:36:09Z","updated_at":"2015-02-20T16:46:40Z","pushed_at":"2015-02-21T04:12:38Z","git_url":"git://github.com/marionettejs/backbone.marionette.git","ssh_url":"git@github.com:marionettejs/backbone.marionette.git","clone_url":"https://github.com/marionettejs/backbone.marionette.git","svn_url":"https://github.com/marionettejs/backbone.marionette","homepage":"http://marionettejs.com","size":21562,"stargazers_count":5898,"watchers_count":5898,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1091,"mirror_url":null,"open_issues_count":131,"forks":1091,"open_issues":131,"watchers":5898,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2316"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2316"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2316/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316/comments"},"review_comment":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2316/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/f4524f8762224387b5880fb412c064af000995af"}}}}