GitHub PullRequestReviewCommentEvent at 2014-12-05 10:59:15
Repository: rizzo
Actor: Ianfeather
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/comments/21366403","id":21366403,"diff_hunk":"@@ -0,0 +1,59 @@\n+define([\n+  \"jquery\",\n+  \"lib/utils/template\"\n+], function($, Template) {\n+\n+  \"use strict\";\n+\n+  // @args = {}\n+  // el: {string} selector for parent element\n+  function PlaceTitleNav( args ) {\n+    this.$el = $(args.el);\n+    this.$list = $(args.list);\n+\n+    this.$el.length && this.init();\n+  }\n+\n+  PlaceTitleNav.prototype.init = function() {\n+    $.each(this.$el.find(\".js-place-title-nav\"), function(i, el) {\n+      this.fetchNavItems(el);\n+    }.bind(this));\n+  };\n+\n+  PlaceTitleNav.prototype.getUrl = function(menuItem) {\n+    return $(menuItem).attr(\"data-slug\") + \"/navitems\";\n+  };\n+\n+  PlaceTitleNav.prototype.fetchNavItems = function(menuItem) {\n+    $.ajax({\n+      url: this.getUrl(menuItem),\n+      dataType: \"json\",\n+      success: function(data) {\n+        this.renderSubMenu(menuItem, data);\n+      }.bind(this)\n+    });\n+\n+  };\n+\n+  PlaceTitleNav.prototype.renderSubMenu = function(menuItem, data) {\n+    if (data && data.length > 0) {\n+\n+      if (!this.navItemTemplate) {","path":"app/assets/javascripts/lib/components/place_title_nav.js","position":41,"original_position":41,"commit_id":"ddea3e71efc0e5cd3d9c77e6adbf3b9ecdf85f84","original_commit_id":"ddea3e71efc0e5cd3d9c77e6adbf3b9ecdf85f84","user":{"login":"Ianfeather","id":814861,"avatar_url":"https://avatars.githubusercontent.com/u/814861?v=3","gravatar_id":"","url":"https://api.github.com/users/Ianfeather","html_url":"https://github.com/Ianfeather","followers_url":"https://api.github.com/users/Ianfeather/followers","following_url":"https://api.github.com/users/Ianfeather/following{/other_user}","gists_url":"https://api.github.com/users/Ianfeather/gists{/gist_id}","starred_url":"https://api.github.com/users/Ianfeather/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ianfeather/subscriptions","organizations_url":"https://api.github.com/users/Ianfeather/orgs","repos_url":"https://api.github.com/users/Ianfeather/repos","events_url":"https://api.github.com/users/Ianfeather/events{/privacy}","received_events_url":"https://api.github.com/users/Ianfeather/received_events","type":"User","site_admin":false},"body":"I'd do this in the constructor. Then you can just not initialise the component if the template doesn't exist.","created_at":"2014-12-05T10:59:15Z","updated_at":"2014-12-05T10:59:15Z","html_url":"https://github.com/lonelyplanet/rizzo/pull/1123#discussion_r21366403","pull_request_url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123","_links":{"self":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/comments/21366403"},"html":{"href":"https://github.com/lonelyplanet/rizzo/pull/1123#discussion_r21366403"},"pull_request":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123"}}},"pull_request":{"url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123","id":25193236,"html_url":"https://github.com/lonelyplanet/rizzo/pull/1123","diff_url":"https://github.com/lonelyplanet/rizzo/pull/1123.diff","patch_url":"https://github.com/lonelyplanet/rizzo/pull/1123.patch","issue_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues/1123","number":1123,"state":"open","locked":false,"title":"Extend place title with submenu options","user":{"login":"jmmerino","id":1152640,"avatar_url":"https://avatars.githubusercontent.com/u/1152640?v=3","gravatar_id":"","url":"https://api.github.com/users/jmmerino","html_url":"https://github.com/jmmerino","followers_url":"https://api.github.com/users/jmmerino/followers","following_url":"https://api.github.com/users/jmmerino/following{/other_user}","gists_url":"https://api.github.com/users/jmmerino/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmerino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmerino/subscriptions","organizations_url":"https://api.github.com/users/jmmerino/orgs","repos_url":"https://api.github.com/users/jmmerino/repos","events_url":"https://api.github.com/users/jmmerino/events{/privacy}","received_events_url":"https://api.github.com/users/jmmerino/received_events","type":"User","site_admin":false},"body":"I've added new options for the component \"place_title\", so it can have submenus. \r\nAlso, I've added new options for the submenu for images and buttons.\r\n\r\nThis is how it looks:\r\n![place_title](https://cloud.githubusercontent.com/assets/1152640/5279782/a6cf023e-7ae8-11e4-826c-c5a6a6517926.gif)\r\n","created_at":"2014-11-28T12:16:24Z","updated_at":"2014-12-05T10:59:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cc471aad361dbaed740d4714ee8d0d54b6624a0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123/commits","review_comments_url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123/comments","review_comment_url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/comments/{number}","comments_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues/1123/comments","statuses_url":"https://api.github.com/repos/lonelyplanet/rizzo/statuses/ddea3e71efc0e5cd3d9c77e6adbf3b9ecdf85f84","head":{"label":"lonelyplanet:jesus/place-title-navigation","ref":"jesus/place-title-navigation","sha":"ddea3e71efc0e5cd3d9c77e6adbf3b9ecdf85f84","user":{"login":"lonelyplanet","id":114767,"avatar_url":"https://avatars.githubusercontent.com/u/114767?v=3","gravatar_id":"","url":"https://api.github.com/users/lonelyplanet","html_url":"https://github.com/lonelyplanet","followers_url":"https://api.github.com/users/lonelyplanet/followers","following_url":"https://api.github.com/users/lonelyplanet/following{/other_user}","gists_url":"https://api.github.com/users/lonelyplanet/gists{/gist_id}","starred_url":"https://api.github.com/users/lonelyplanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lonelyplanet/subscriptions","organizations_url":"https://api.github.com/users/lonelyplanet/orgs","repos_url":"https://api.github.com/users/lonelyplanet/repos","events_url":"https://api.github.com/users/lonelyplanet/events{/privacy}","received_events_url":"https://api.github.com/users/lonelyplanet/received_events","type":"Organization","site_admin":false},"repo":{"id":4184894,"name":"rizzo","full_name":"lonelyplanet/rizzo","owner":{"login":"lonelyplanet","id":114767,"avatar_url":"https://avatars.githubusercontent.com/u/114767?v=3","gravatar_id":"","url":"https://api.github.com/users/lonelyplanet","html_url":"https://github.com/lonelyplanet","followers_url":"https://api.github.com/users/lonelyplanet/followers","following_url":"https://api.github.com/users/lonelyplanet/following{/other_user}","gists_url":"https://api.github.com/users/lonelyplanet/gists{/gist_id}","starred_url":"https://api.github.com/users/lonelyplanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lonelyplanet/subscriptions","organizations_url":"https://api.github.com/users/lonelyplanet/orgs","repos_url":"https://api.github.com/users/lonelyplanet/repos","events_url":"https://api.github.com/users/lonelyplanet/events{/privacy}","received_events_url":"https://api.github.com/users/lonelyplanet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lonelyplanet/rizzo","description":"UI Layer for lonelyplanet.com","fork":false,"url":"https://api.github.com/repos/lonelyplanet/rizzo","forks_url":"https://api.github.com/repos/lonelyplanet/rizzo/forks","keys_url":"https://api.github.com/repos/lonelyplanet/rizzo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lonelyplanet/rizzo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lonelyplanet/rizzo/teams","hooks_url":"https://api.github.com/repos/lonelyplanet/rizzo/hooks","issue_events_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues/events{/number}","events_url":"https://api.github.com/repos/lonelyplanet/rizzo/events","assignees_url":"https://api.github.com/repos/lonelyplanet/rizzo/assignees{/user}","branches_url":"https://api.github.com/repos/lonelyplanet/rizzo/branches{/branch}","tags_url":"https://api.github.com/repos/lonelyplanet/rizzo/tags","blobs_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lonelyplanet/rizzo/statuses/{sha}","languages_url":"https://api.github.com/repos/lonelyplanet/rizzo/languages","stargazers_url":"https://api.github.com/repos/lonelyplanet/rizzo/stargazers","contributors_url":"https://api.github.com/repos/lonelyplanet/rizzo/contributors","subscribers_url":"https://api.github.com/repos/lonelyplanet/rizzo/subscribers","subscription_url":"https://api.github.com/repos/lonelyplanet/rizzo/subscription","commits_url":"https://api.github.com/repos/lonelyplanet/rizzo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lonelyplanet/rizzo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues/comments/{number}","contents_url":"https://api.github.com/repos/lonelyplanet/rizzo/contents/{+path}","compare_url":"https://api.github.com/repos/lonelyplanet/rizzo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lonelyplanet/rizzo/merges","archive_url":"https://api.github.com/repos/lonelyplanet/rizzo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lonelyplanet/rizzo/downloads","issues_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues{/number}","pulls_url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls{/number}","milestones_url":"https://api.github.com/repos/lonelyplanet/rizzo/milestones{/number}","notifications_url":"https://api.github.com/repos/lonelyplanet/rizzo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lonelyplanet/rizzo/labels{/name}","releases_url":"https://api.github.com/repos/lonelyplanet/rizzo/releases{/id}","created_at":"2012-04-30T17:06:06Z","updated_at":"2014-12-05T09:56:23Z","pushed_at":"2014-12-05T10:16:19Z","git_url":"git://github.com/lonelyplanet/rizzo.git","ssh_url":"git@github.com:lonelyplanet/rizzo.git","clone_url":"https://github.com/lonelyplanet/rizzo.git","svn_url":"https://github.com/lonelyplanet/rizzo","homepage":"","size":122011,"stargazers_count":268,"watchers_count":268,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":12,"forks":24,"open_issues":12,"watchers":268,"default_branch":"master"}},"base":{"label":"lonelyplanet:master","ref":"master","sha":"d69bf151c254fd255ec01d36b77a04ef02e72e1d","user":{"login":"lonelyplanet","id":114767,"avatar_url":"https://avatars.githubusercontent.com/u/114767?v=3","gravatar_id":"","url":"https://api.github.com/users/lonelyplanet","html_url":"https://github.com/lonelyplanet","followers_url":"https://api.github.com/users/lonelyplanet/followers","following_url":"https://api.github.com/users/lonelyplanet/following{/other_user}","gists_url":"https://api.github.com/users/lonelyplanet/gists{/gist_id}","starred_url":"https://api.github.com/users/lonelyplanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lonelyplanet/subscriptions","organizations_url":"https://api.github.com/users/lonelyplanet/orgs","repos_url":"https://api.github.com/users/lonelyplanet/repos","events_url":"https://api.github.com/users/lonelyplanet/events{/privacy}","received_events_url":"https://api.github.com/users/lonelyplanet/received_events","type":"Organization","site_admin":false},"repo":{"id":4184894,"name":"rizzo","full_name":"lonelyplanet/rizzo","owner":{"login":"lonelyplanet","id":114767,"avatar_url":"https://avatars.githubusercontent.com/u/114767?v=3","gravatar_id":"","url":"https://api.github.com/users/lonelyplanet","html_url":"https://github.com/lonelyplanet","followers_url":"https://api.github.com/users/lonelyplanet/followers","following_url":"https://api.github.com/users/lonelyplanet/following{/other_user}","gists_url":"https://api.github.com/users/lonelyplanet/gists{/gist_id}","starred_url":"https://api.github.com/users/lonelyplanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lonelyplanet/subscriptions","organizations_url":"https://api.github.com/users/lonelyplanet/orgs","repos_url":"https://api.github.com/users/lonelyplanet/repos","events_url":"https://api.github.com/users/lonelyplanet/events{/privacy}","received_events_url":"https://api.github.com/users/lonelyplanet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lonelyplanet/rizzo","description":"UI Layer for lonelyplanet.com","fork":false,"url":"https://api.github.com/repos/lonelyplanet/rizzo","forks_url":"https://api.github.com/repos/lonelyplanet/rizzo/forks","keys_url":"https://api.github.com/repos/lonelyplanet/rizzo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lonelyplanet/rizzo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lonelyplanet/rizzo/teams","hooks_url":"https://api.github.com/repos/lonelyplanet/rizzo/hooks","issue_events_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues/events{/number}","events_url":"https://api.github.com/repos/lonelyplanet/rizzo/events","assignees_url":"https://api.github.com/repos/lonelyplanet/rizzo/assignees{/user}","branches_url":"https://api.github.com/repos/lonelyplanet/rizzo/branches{/branch}","tags_url":"https://api.github.com/repos/lonelyplanet/rizzo/tags","blobs_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/refs{/sha}","trees_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lonelyplanet/rizzo/statuses/{sha}","languages_url":"https://api.github.com/repos/lonelyplanet/rizzo/languages","stargazers_url":"https://api.github.com/repos/lonelyplanet/rizzo/stargazers","contributors_url":"https://api.github.com/repos/lonelyplanet/rizzo/contributors","subscribers_url":"https://api.github.com/repos/lonelyplanet/rizzo/subscribers","subscription_url":"https://api.github.com/repos/lonelyplanet/rizzo/subscription","commits_url":"https://api.github.com/repos/lonelyplanet/rizzo/commits{/sha}","git_commits_url":"https://api.github.com/repos/lonelyplanet/rizzo/git/commits{/sha}","comments_url":"https://api.github.com/repos/lonelyplanet/rizzo/comments{/number}","issue_comment_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues/comments/{number}","contents_url":"https://api.github.com/repos/lonelyplanet/rizzo/contents/{+path}","compare_url":"https://api.github.com/repos/lonelyplanet/rizzo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lonelyplanet/rizzo/merges","archive_url":"https://api.github.com/repos/lonelyplanet/rizzo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lonelyplanet/rizzo/downloads","issues_url":"https://api.github.com/repos/lonelyplanet/rizzo/issues{/number}","pulls_url":"https://api.github.com/repos/lonelyplanet/rizzo/pulls{/number}","milestones_url":"https://api.github.com/repos/lonelyplanet/rizzo/milestones{/number}","notifications_url":"https://api.github.com/repos/lonelyplanet/rizzo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lonelyplanet/rizzo/labels{/name}","releases_url":"https://api.github.com/repos/lonelyplanet/rizzo/releases{/id}","created_at":"2012-04-30T17:06:06Z","updated_at":"2014-12-05T09:56:23Z","pushed_at":"2014-12-05T10:16:19Z","git_url":"git://github.com/lonelyplanet/rizzo.git","ssh_url":"git@github.com:lonelyplanet/rizzo.git","clone_url":"https://github.com/lonelyplanet/rizzo.git","svn_url":"https://github.com/lonelyplanet/rizzo","homepage":"","size":122011,"stargazers_count":268,"watchers_count":268,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":12,"forks":24,"open_issues":12,"watchers":268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123"},"html":{"href":"https://github.com/lonelyplanet/rizzo/pull/1123"},"issue":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/issues/1123"},"comments":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/issues/1123/comments"},"review_comments":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123/comments"},"review_comment":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/pulls/1123/commits"},"statuses":{"href":"https://api.github.com/repos/lonelyplanet/rizzo/statuses/ddea3e71efc0e5cd3d9c77e6adbf3b9ecdf85f84"}}}}