{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/comments/45063675","id":45063675,"diff_hunk":"@@ -0,0 +1,192 @@\n+/// <reference path=\"../app.ts\" />\n+'use strict';\n+\n+App.DiscussionEditorComponent = Em.Component.extend(App.ViewportMixin, {\n+\tattributeBindings: ['style'],\n+\tclassNames: ['discussion-editor', 'mobile-hidden'],\n+\tclassNameBindings: ['isActive', 'hasError'],\n+\n+\tisActive: false,\n+\tisSticky: false,\n+\n+\tsubmitDisabled: true,\n+\tisLoading: false,\n+\tshowSuccess: false,\n+\thasError: false,\n+\n+\toffsetTop: 0,\n+\tsiteHeadHeight: 0,\n+\n+\t/**\n+\t * Set right height for editor placeholder when editor gets sticky\n+\t * @returns {void}\n+\t */\n+\tstyle: Em.computed('isSticky', function (): string {\n+\t\treturn this.get('isSticky') === true\n+\t\t\t? `height: ${this.$('.editor-container').outerHeight(true)}px`\n+\t\t\t: null;\n+\t}),\n+\n+\t/**\n+\t * Initialize onScroll binding for sticky logic\n+\t * @returns {void}\n+\t */\n+\tinitializeOnScroll(): void {\n+\t\tthis.offsetTop = this.$().offset().top;\n+\t\tthis.siteHeadHeight = Em.$('.site-head').outerHeight(true);\n+\n+\t\tEm.$(window).on('scroll', (): void => {\n+\t\t\tthis.onScroll()\n+\t\t});\n+\t},\n+\n+\tgetBreakpointHeight(): number {\n+\t\treturn this.offsetTop - (this.get('siteHeadPinned') ? this.siteHeadHeight : 0);\n+\t},\n+\n+\tonScroll(): void {\n+\t\tEm.run.throttle(\n+\t\t\tthis,\n+\t\t\tfunction (): void {\n+\t\t\t\tif (window.pageYOffset >= this.getBreakpointHeight() && !this.get('isSticky')) {\n+\t\t\t\t\tthis.set('isSticky', true);\n+\t\t\t\t} else if (window.pageYOffset < this.getBreakpointHeight() && this.get('isSticky')) {\n+\t\t\t\t\tthis.set('isSticky', false);\n+\t\t\t\t}\n+\t\t\t},\n+\t\t\t25\n+\t\t);\n+\t},\n+\n+\t/**\n+\t * @returns {void}\n+\t */\n+\tdidInsertElement(): void {\n+\t\tthis._super();\n+\n+\t\tthis.initializeOnScroll();\n+\t},\n+\n+\t/**\n+\t * @returns {void}\n+\t */\n+\twillDestroyElement(): void {\n+\t\tEm.$(window).off('scroll', this.onScroll);\n+\t},\n+\n+\t/**\n+\t * Handle recalculation of placeholder size on resize\n+\t * @returns {void}\n+\t */\n+\tviewportChangeObserver: Em.observer('viewportDimensions.width', function (): void {\n+\t\tEm.$(window).off('scroll', this.onScroll);\n+\t\tthis.initializeOnScroll();\n+\t}),\n+\n+\t/**\n+\t * Perform animations and logic after post creation\n+\t * @returns {void}\n+\t */\n+\thandleNewPostCreated: Em.observer('posts.@each._embedded.firstPost[0].isNew', function (): void {\n+\t\tvar newPosts = this.get('posts').filter(function (post: any): boolean {\n+\t\t\treturn post._embedded.firstPost[0].isNew;\n+\t\t}),","path":"front/scripts/main/components/DiscussionEditorComponent.ts","position":93,"original_position":93,"commit_id":"e44dd4e291f862c209d8ee1ea9058f52c66a23f9","original_commit_id":"e44dd4e291f862c209d8ee1ea9058f52c66a23f9","user":{"login":"rogatty","id":7030884,"avatar_url":"https://avatars.githubusercontent.com/u/7030884?v=3","gravatar_id":"","url":"https://api.github.com/users/rogatty","html_url":"https://github.com/rogatty","followers_url":"https://api.github.com/users/rogatty/followers","following_url":"https://api.github.com/users/rogatty/following{/other_user}","gists_url":"https://api.github.com/users/rogatty/gists{/gist_id}","starred_url":"https://api.github.com/users/rogatty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rogatty/subscriptions","organizations_url":"https://api.github.com/users/rogatty/orgs","repos_url":"https://api.github.com/users/rogatty/repos","events_url":"https://api.github.com/users/rogatty/events{/privacy}","received_events_url":"https://api.github.com/users/rogatty/received_events","type":"User","site_admin":false},"body":"I think indentation is broken here.","created_at":"2015-11-17T14:13:59Z","updated_at":"2015-11-17T14:13:59Z","html_url":"https://github.com/Wikia/mercury/pull/1614#discussion_r45063675","pull_request_url":"https://api.github.com/repos/Wikia/mercury/pulls/1614","_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments/45063675"},"html":{"href":"https://github.com/Wikia/mercury/pull/1614#discussion_r45063675"},"pull_request":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/1614"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/1614","id":50114069,"html_url":"https://github.com/Wikia/mercury/pull/1614","diff_url":"https://github.com/Wikia/mercury/pull/1614.diff","patch_url":"https://github.com/Wikia/mercury/pull/1614.patch","issue_url":"https://api.github.com/repos/Wikia/mercury/issues/1614","number":1614,"state":"open","locked":false,"title":"SOC-1420 | Discussion posts editor","user":{"login":"bkoval","id":2035428,"avatar_url":"https://avatars.githubusercontent.com/u/2035428?v=3","gravatar_id":"","url":"https://api.github.com/users/bkoval","html_url":"https://github.com/bkoval","followers_url":"https://api.github.com/users/bkoval/followers","following_url":"https://api.github.com/users/bkoval/following{/other_user}","gists_url":"https://api.github.com/users/bkoval/gists{/gist_id}","starred_url":"https://api.github.com/users/bkoval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkoval/subscriptions","organizations_url":"https://api.github.com/users/bkoval/orgs","repos_url":"https://api.github.com/users/bkoval/repos","events_url":"https://api.github.com/users/bkoval/events{/privacy}","received_events_url":"https://api.github.com/users/bkoval/received_events","type":"User","site_admin":false},"body":"https://wikia-inc.atlassian.net/browse/SOC-1420\r\n\r\nThis pull request includes:\r\n1) Inline posts editor for desktop resolutions\r\n2) Dedicated view posts editor for mobile resolutions\r\n3) Full functionality of posting with error handling","created_at":"2015-11-09T11:59:50Z","updated_at":"2015-11-17T14:13:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bca35c4b861dd8ed324268944385de31bc3f10e7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/mercury/pulls/1614/commits","review_comments_url":"https://api.github.com/repos/Wikia/mercury/pulls/1614/comments","review_comment_url":"https://api.github.com/repos/Wikia/mercury/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/mercury/issues/1614/comments","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/e44dd4e291f862c209d8ee1ea9058f52c66a23f9","head":{"label":"Wikia:SOC-1420","ref":"SOC-1420","sha":"e44dd4e291f862c209d8ee1ea9058f52c66a23f9","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","created_at":"2014-02-10T21:44:25Z","updated_at":"2015-11-04T16:44:03Z","pushed_at":"2015-11-17T14:11:47Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"","size":50766,"stargazers_count":12,"watchers_count":12,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":12,"forks":3,"open_issues":12,"watchers":12,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"a3481504ee85ebcc6682f6cf2b52db6662494b3b","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","created_at":"2014-02-10T21:44:25Z","updated_at":"2015-11-04T16:44:03Z","pushed_at":"2015-11-17T14:11:47Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"","size":50766,"stargazers_count":12,"watchers_count":12,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":12,"forks":3,"open_issues":12,"watchers":12,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/1614"},"html":{"href":"https://github.com/Wikia/mercury/pull/1614"},"issue":{"href":"https://api.github.com/repos/Wikia/mercury/issues/1614"},"comments":{"href":"https://api.github.com/repos/Wikia/mercury/issues/1614/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/1614/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/1614/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/mercury/statuses/e44dd4e291f862c209d8ee1ea9058f52c66a23f9"}}}}