{"action":"created","comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/24054145","id":24054145,"diff_hunk":"@@ -105,5 +122,122 @@ Marionette.ItemView = Marionette.AbstractView.extend({\n     this.$el.html(html);\n \n     return this;\n+  },\n+\n+  // Add a single region, by name, to the layoutView\n+  addRegion: function(name, definition) {\n+    var regions = {};\n+    regions[name] = definition;\n+    return this._buildRegions(regions)[name];\n+  },\n+\n+  // Add multiple regions as a {name: definition, name2: def2} object literal\n+  addRegions: function(regions) {\n+    this.regions = _.extend({}, this.regions, regions);\n+    return this._buildRegions(regions);\n+  },\n+\n+  // Remove a single region from the LayoutView, by name\n+  removeRegion: function(name) {\n+    delete this.regions[name];\n+    return this.regionManager.removeRegion(name);\n+  },\n+\n+  // Provides alternative access to regions\n+  // Accepts the region name\n+  // getRegion('main')\n+  getRegion: function(region) {\n+    return this.regionManager.get(region);\n+  },\n+\n+  // Get all regions\n+  getRegions: function(){\n+    return this.regionManager.getRegions();\n+  },\n+\n+  // Enable easy overriding of the default `RegionManager`\n+  // for customized region interactions and business specific\n+  // view logic for better control over single regions.\n+  getRegionManager: function() {\n+    return new Marionette.RegionManager();\n+  },\n+\n+  // Handle destroying regions, and then destroy the view itself.\n+  destroy: function() {\n+    if (this.isDestroyed) { return this; }\n+\n+    this.regionManager.destroy();\n+    return Marionette.AbstractView.prototype.destroy.apply(this, arguments);\n+  },\n+\n+  // Internal method to initialize the regions that have been defined in a\n+  // `regions` attribute on this layoutView.\n+  _initializeRegions: function(options) {\n+    var regions;\n+    this._initRegionManager();\n+\n+    regions = Marionette._getValue(this.regions, this, [options]) || {};\n+\n+    // Enable users to define `regions` as instance options.\n+    var regionOptions = this.getOption.call(options, 'regions');\n+\n+    // enable region options to be a function\n+    regionOptions = Marionette._getValue(regionOptions, this, [options]);\n+\n+    _.extend(regions, regionOptions);\n+\n+    // Normalize region selectors hash to allow\n+    // a user to use the @ui. syntax.\n+    regions = this.normalizeUIValues(regions);\n+\n+    this.addRegions(regions);\n+  },\n+\n+  // internal method to build regions\n+  _buildRegions: function(regions) {\n+    var defaults = {\n+      regionClass: this.getOption('regionClass'),\n+      parentEl: _.partial(_.result, this, 'el')\n+    };\n+\n+    return this.regionManager.addRegions(regions, defaults);\n+  },\n+\n+  // Internal method to re-initialize all of the regions by updating\n+  // the `el` that they point to\n+  _reInitializeRegions: function() {\n+    this.regionManager.invoke('reset');\n+  },\n+\n+  // Internal method to initialize the region manager\n+  // and all regions in it\n+  _initRegionManager: function() {\n+    this.regionManager = this.getRegionManager();\n+    this.regionManager._parent = this;\n+\n+    this.listenTo(this.regionManager, 'before:add:region', function(name) {","path":"src/item-view.js","position":143,"original_position":143,"commit_id":"b14e7685f003218d4bc6a96fddbf285456b75851","original_commit_id":"b14e7685f003218d4bc6a96fddbf285456b75851","user":{"login":"thejameskyle","id":952783,"avatar_url":"https://avatars.githubusercontent.com/u/952783?v=3","gravatar_id":"","url":"https://api.github.com/users/thejameskyle","html_url":"https://github.com/thejameskyle","followers_url":"https://api.github.com/users/thejameskyle/followers","following_url":"https://api.github.com/users/thejameskyle/following{/other_user}","gists_url":"https://api.github.com/users/thejameskyle/gists{/gist_id}","starred_url":"https://api.github.com/users/thejameskyle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejameskyle/subscriptions","organizations_url":"https://api.github.com/users/thejameskyle/orgs","repos_url":"https://api.github.com/users/thejameskyle/repos","events_url":"https://api.github.com/users/thejameskyle/events{/privacy}","received_events_url":"https://api.github.com/users/thejameskyle/received_events","type":"User","site_admin":false},"body":"stop it","created_at":"2015-02-04T00:38:47Z","updated_at":"2015-02-04T00:38:47Z","html_url":"https://github.com/marionettejs/backbone.marionette/pull/2253#discussion_r24054145","pull_request_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253","_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/24054145"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2253#discussion_r24054145"},"pull_request":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253"}}},"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253","id":28599843,"html_url":"https://github.com/marionettejs/backbone.marionette/pull/2253","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/2253.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/2253.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2253","number":2253,"state":"open","locked":false,"title":"Merge LayoutView into ItemView.","user":{"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},"body":"Resolves #2251\r\n\r\nWIP","created_at":"2015-02-03T23:30:24Z","updated_at":"2015-02-04T00:38:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68c3edaea8478bcb1cc30ad030ceb95a974e26f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253/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/2253/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/b14e7685f003218d4bc6a96fddbf285456b75851","head":{"label":"marionettejs:layout-view","ref":"layout-view","sha":"b14e7685f003218d4bc6a96fddbf285456b75851","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-03T23:30:13Z","pushed_at":"2015-02-03T23:30:04Z","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":20371,"stargazers_count":5825,"watchers_count":5825,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1082,"mirror_url":null,"open_issues_count":103,"forks":1082,"open_issues":103,"watchers":5825,"default_branch":"master"}},"base":{"label":"marionettejs:major","ref":"major","sha":"61c66c51a913d24202523d004c057bb9b23c065f","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-03T23:30:13Z","pushed_at":"2015-02-03T23:30:04Z","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":20371,"stargazers_count":5825,"watchers_count":5825,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1082,"mirror_url":null,"open_issues_count":103,"forks":1082,"open_issues":103,"watchers":5825,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/2253"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2253"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/2253/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/2253/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/2253/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/b14e7685f003218d4bc6a96fddbf285456b75851"}}}}