{"action":"created","comment":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/70204121","id":70204121,"diff_hunk":"@@ -882,6 +886,149 @@ view.addRegion(\"foo\", \"#bar\");\n view.removeRegion(\"foo\");\n ```\n \n+### Binding To User Input\n+\n+Views can bind custom events whenever users perform some interaction with the\n+DOM. Using the view `events` and `triggers` handlers lets us either bind  user\n+input directly to an action or fire a generic trigger that may or may not be\n+handled.\n+\n+#### View `events`\n+\n+The view `events` attribute binds DOM events to functions or methods on the\n+view. The simplest form is to reference a method on the view:\n+\n+```javascript\n+var Mn = require('backbone.marionette');\n+\n+var MyView = Mn.View.extend({\n+  events: {\n+    'click a': 'showModal'\n+  },\n+\n+  showModal: function(event) {\n+    console.log('Show the modal');\n+  }\n+});\n+```\n+\n+The DOM event gets passed in as the first argument, allowing you to see any\n+information passed as part of the event.\n+\n+**When passing a method reference, the method must exist on the View.**\n+\n+##### Defining Listeners\n+\n+Listeners are defined as:\n+\n+```javascript\n+eventname jqueryselector\n+```\n+\n+* The `eventname` part refers to a jQuery DOM event e.g. `click` or `change`.\n+* The `jqueryselector` part is a jQuery selector string e.g. `.myclass`\n+\n+You can also pass just the eventname part causing the event handler to fire on\n+the entire view. This is especially useful for buttons and click handlers:\n+\n+```javascript\n+var Mn = require('backbone.marionette');\n+\n+var ButtonView = Mn.View.extend({\n+  tagName: 'button',\n+\n+  events: {\n+    click: 'showAlert'\n+  },\n+\n+  showAlert: function() {\n+    alert('Button was clicked');\n+  }\n+});\n+```\n+\n+##### Passing a Function\n+\n+The `events` attribute can also directly bind functions:\n+\n+```javascript\n+var Mn = require('backbone.marionette');\n+\n+var MyView = Mn.View.extend({\n+  events: {\n+    'click a': function(event) {\n+      console.log('Show the modal');\n+    }\n+  }\n+});\n+```\n+\n+As when passing a string reference to a view method, the `events` attribute\n+passes in the `event` as the argument to the function called.\n+\n+#### View `triggers`\n+\n+The view `triggers` attribute binds DOM events to Marionette View events that\n+can be responded to at the view or parent level. For more information on events,\n+see the [events documentation](./marionette.events.md). This section will just\n+cover how to bind these events to views.\n+\n+```javascript\n+var Mn = require('backbone.marionette');\n+\n+var MyView = Mn.View.extend({\n+  triggers: {\n+    'click a': 'link:clicked'\n+  },\n+\n+  onLinkClicked: function() {\n+    console.log('Show the modal');\n+  }\n+});\n+```\n+\n+When the `a` tag is clicked here, the `link:click` event is fired. This event\n+can be listened to using the\n+[Magic Method Binding](./marionette.events.md#magic-method-binding) technique\n+discussed in the [events documentation](./marionette.events.md).\n+\n+##### Defining Listeners\n+\n+Listeners are defined as:\n+\n+```javascript\n+eventname jqueryselector\n+```","path":"docs/marionette.view.md","position":104,"original_position":179,"commit_id":"375956115055e8c8c3ea99bbc4d4252e6a264e8f","original_commit_id":"375956115055e8c8c3ea99bbc4d4252e6a264e8f","user":{"login":"rafde","id":833429,"avatar_url":"https://avatars.githubusercontent.com/u/833429?v=3","gravatar_id":"","url":"https://api.github.com/users/rafde","html_url":"https://github.com/rafde","followers_url":"https://api.github.com/users/rafde/followers","following_url":"https://api.github.com/users/rafde/following{/other_user}","gists_url":"https://api.github.com/users/rafde/gists{/gist_id}","starred_url":"https://api.github.com/users/rafde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafde/subscriptions","organizations_url":"https://api.github.com/users/rafde/orgs","repos_url":"https://api.github.com/users/rafde/repos","events_url":"https://api.github.com/users/rafde/events{/privacy}","received_events_url":"https://api.github.com/users/rafde/received_events","type":"User","site_admin":false},"body":"from [here](https://github.com/marionettejs/backbone.marionette/pull/3061/files#diff-754a14ba135eb5c5b22e5325d9d4092fR1001)\r\nto [this line](https://github.com/marionettejs/backbone.marionette/pull/3061/files#diff-754a14ba135eb5c5b22e5325d9d4092fR1029) looks the same if no similar to \r\nhttps://github.com/marionettejs/backbone.marionette/pull/3061/files#diff-754a14ba135eb5c5b22e5325d9d4092fR926","created_at":"2016-07-11T05:35:12Z","updated_at":"2016-07-11T05:35:12Z","html_url":"https://github.com/marionettejs/backbone.marionette/pull/3061#discussion_r70204121","pull_request_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061","_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/comments/70204121"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/3061#discussion_r70204121"},"pull_request":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061"}}},"pull_request":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061","id":73470046,"html_url":"https://github.com/marionettejs/backbone.marionette/pull/3061","diff_url":"https://github.com/marionettejs/backbone.marionette/pull/3061.diff","patch_url":"https://github.com/marionettejs/backbone.marionette/pull/3061.patch","issue_url":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3061","number":3061,"state":"open","locked":false,"title":"Advanced event doc","user":{"login":"scott-w","id":1969937,"avatar_url":"https://avatars.githubusercontent.com/u/1969937?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-w","html_url":"https://github.com/scott-w","followers_url":"https://api.github.com/users/scott-w/followers","following_url":"https://api.github.com/users/scott-w/following{/other_user}","gists_url":"https://api.github.com/users/scott-w/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-w/subscriptions","organizations_url":"https://api.github.com/users/scott-w/orgs","repos_url":"https://api.github.com/users/scott-w/repos","events_url":"https://api.github.com/users/scott-w/events{/privacy}","received_events_url":"https://api.github.com/users/scott-w/received_events","type":"User","site_admin":false},"body":"### Proposed changes\r\n - Adds event docs in their own where they can be linked from `View` and `CollectionView`\r\n - Adds the missing `events` and `triggers` attributes to `View`\r\n - Added notice to the Upgrade Guide\r\n\r\nLink to the issue: #2920 #2971 \r\n","created_at":"2016-06-11T14:56:39Z","updated_at":"2016-07-11T05:35:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d3980a5339287c60265219ecef07777095bb63e","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones/12","html_url":"https://github.com/marionettejs/backbone.marionette/milestones/v3.0.0","labels_url":"https://api.github.com/repos/marionettejs/backbone.marionette/milestones/12/labels","id":630229,"number":12,"title":"v3.0.0","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":6,"closed_issues":210,"state":"open","created_at":"2014-04-15T03:06:11Z","updated_at":"2016-07-10T19:11:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061/commits","review_comments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061/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/3061/comments","statuses_url":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/375956115055e8c8c3ea99bbc4d4252e6a264e8f","head":{"label":"scott-w:advanced-event-doc","ref":"advanced-event-doc","sha":"375956115055e8c8c3ea99bbc4d4252e6a264e8f","user":{"login":"scott-w","id":1969937,"avatar_url":"https://avatars.githubusercontent.com/u/1969937?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-w","html_url":"https://github.com/scott-w","followers_url":"https://api.github.com/users/scott-w/followers","following_url":"https://api.github.com/users/scott-w/following{/other_user}","gists_url":"https://api.github.com/users/scott-w/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-w/subscriptions","organizations_url":"https://api.github.com/users/scott-w/orgs","repos_url":"https://api.github.com/users/scott-w/repos","events_url":"https://api.github.com/users/scott-w/events{/privacy}","received_events_url":"https://api.github.com/users/scott-w/received_events","type":"User","site_admin":false},"repo":{"id":31324470,"name":"backbone.marionette","full_name":"scott-w/backbone.marionette","owner":{"login":"scott-w","id":1969937,"avatar_url":"https://avatars.githubusercontent.com/u/1969937?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-w","html_url":"https://github.com/scott-w","followers_url":"https://api.github.com/users/scott-w/followers","following_url":"https://api.github.com/users/scott-w/following{/other_user}","gists_url":"https://api.github.com/users/scott-w/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-w/subscriptions","organizations_url":"https://api.github.com/users/scott-w/orgs","repos_url":"https://api.github.com/users/scott-w/repos","events_url":"https://api.github.com/users/scott-w/events{/privacy}","received_events_url":"https://api.github.com/users/scott-w/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scott-w/backbone.marionette","description":"The Backbone Framework","fork":true,"url":"https://api.github.com/repos/scott-w/backbone.marionette","forks_url":"https://api.github.com/repos/scott-w/backbone.marionette/forks","keys_url":"https://api.github.com/repos/scott-w/backbone.marionette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scott-w/backbone.marionette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scott-w/backbone.marionette/teams","hooks_url":"https://api.github.com/repos/scott-w/backbone.marionette/hooks","issue_events_url":"https://api.github.com/repos/scott-w/backbone.marionette/issues/events{/number}","events_url":"https://api.github.com/repos/scott-w/backbone.marionette/events","assignees_url":"https://api.github.com/repos/scott-w/backbone.marionette/assignees{/user}","branches_url":"https://api.github.com/repos/scott-w/backbone.marionette/branches{/branch}","tags_url":"https://api.github.com/repos/scott-w/backbone.marionette/tags","blobs_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/refs{/sha}","trees_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scott-w/backbone.marionette/statuses/{sha}","languages_url":"https://api.github.com/repos/scott-w/backbone.marionette/languages","stargazers_url":"https://api.github.com/repos/scott-w/backbone.marionette/stargazers","contributors_url":"https://api.github.com/repos/scott-w/backbone.marionette/contributors","subscribers_url":"https://api.github.com/repos/scott-w/backbone.marionette/subscribers","subscription_url":"https://api.github.com/repos/scott-w/backbone.marionette/subscription","commits_url":"https://api.github.com/repos/scott-w/backbone.marionette/commits{/sha}","git_commits_url":"https://api.github.com/repos/scott-w/backbone.marionette/git/commits{/sha}","comments_url":"https://api.github.com/repos/scott-w/backbone.marionette/comments{/number}","issue_comment_url":"https://api.github.com/repos/scott-w/backbone.marionette/issues/comments{/number}","contents_url":"https://api.github.com/repos/scott-w/backbone.marionette/contents/{+path}","compare_url":"https://api.github.com/repos/scott-w/backbone.marionette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scott-w/backbone.marionette/merges","archive_url":"https://api.github.com/repos/scott-w/backbone.marionette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scott-w/backbone.marionette/downloads","issues_url":"https://api.github.com/repos/scott-w/backbone.marionette/issues{/number}","pulls_url":"https://api.github.com/repos/scott-w/backbone.marionette/pulls{/number}","milestones_url":"https://api.github.com/repos/scott-w/backbone.marionette/milestones{/number}","notifications_url":"https://api.github.com/repos/scott-w/backbone.marionette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scott-w/backbone.marionette/labels{/name}","releases_url":"https://api.github.com/repos/scott-w/backbone.marionette/releases{/id}","deployments_url":"https://api.github.com/repos/scott-w/backbone.marionette/deployments","created_at":"2015-02-25T16:52:48Z","updated_at":"2016-05-13T19:57:44Z","pushed_at":"2016-07-10T19:00:44Z","git_url":"git://github.com/scott-w/backbone.marionette.git","ssh_url":"git@github.com:scott-w/backbone.marionette.git","clone_url":"https://github.com/scott-w/backbone.marionette.git","svn_url":"https://github.com/scott-w/backbone.marionette","homepage":"http://marionettejs.com","size":12192,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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:next","ref":"next","sha":"7a740ed60ecc51b84d26b7e718c1172b1888965f","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}","deployments_url":"https://api.github.com/repos/marionettejs/backbone.marionette/deployments","created_at":"2011-12-12T16:36:09Z","updated_at":"2016-07-10T00:05:49Z","pushed_at":"2016-07-10T19:00:47Z","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":19750,"stargazers_count":6917,"watchers_count":6917,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1359,"mirror_url":null,"open_issues_count":117,"forks":1359,"open_issues":117,"watchers":6917,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061"},"html":{"href":"https://github.com/marionettejs/backbone.marionette/pull/3061"},"issue":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3061"},"comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/issues/3061/comments"},"review_comments":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/pulls/3061/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/3061/commits"},"statuses":{"href":"https://api.github.com/repos/marionettejs/backbone.marionette/statuses/375956115055e8c8c3ea99bbc4d4252e6a264e8f"}}}}
{"actor":{"display_login":"rafde"}}