{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/comments/201417677","pull_request_review_id":135909309,"id":201417677,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTQxNzY3Nw==","diff_hunk":"@@ -0,0 +1,95 @@\n+import { DesignerPeer } from \"../card-designer\";\n+import * as Utils from \"../utils\";\n+\n+export default class TreeItem {\n+    readonly owner: DesignerPeer;\n+    private _listElement: HTMLElement;\n+    private _childContainerElement: HTMLElement;\n+    private _isExpanded: boolean = true;\n+\n+    constructor(owner: DesignerPeer) {\n+        this.owner = owner;\n+    }\n+\n+    render(indentationLevel: number = 0): HTMLElement {\n+        let rootElement = document.createElement(\"div\");\n+        rootElement.className = \"treeview__container\";\n+\n+        this._listElement = this.internalRender(indentationLevel);\n+        rootElement.appendChild(this._listElement);\n+\n+        if (this.owner.getChildCount() > 0) {\n+            rootElement.appendChild(this.renderChildList(indentationLevel));\n+        }\n+\n+        this.updateLayout();\n+        return rootElement;\n+    }\n+\n+    private renderChildList(indentationLevel: number): HTMLElement {\n+        this._childContainerElement = document.createElement(\"div\");\n+        this._childContainerElement.className = \"treeview__container\";\n+\n+        for (let i = 0; i < this.owner.getChildCount(); i++) {\n+            let currentItem = this.owner.getChildAt(i);\n+            this._childContainerElement.appendChild(currentItem.treeItem.render(indentationLevel + 1));\n+        }\n+\n+        if (!this._isExpanded) {\n+            this._childContainerElement.classList.add(\"is-folded\");\n+        }\n+\n+        return this._childContainerElement;\n+    }\n+\n+    private internalRender (indentationLevel: number): HTMLElement {\n+        let listItem = document.createElement(\"div\");\n+        listItem.className = \"treeview__element\";\n+\n+        listItem.onclick = (e: MouseEvent) => {\n+            this.owner.isSelected = true;\n+\n+            e.cancelBubble = true;\n+            e.preventDefault();\n+        }\n+\n+        if (this.owner.getChildCount() > 0) {\n+            let foldArrow = document.createElement(\"button\");\n+            foldArrow.onclick = (e: MouseEvent) => {\n+                e.cancelBubble = true;\n+                e.preventDefault();\n+                foldArrow.classList.toggle(\"is-rotated\");\n+                this.foldTreeViewContainer();\n+            }\n+\n+            foldArrow.className = `treeview__icon treeview__icon--arrow ${!this._isExpanded ? \"is-rotated\" : \"\"}`;\n+            listItem.appendChild(foldArrow);\n+        }\n+\n+        let icon = document.createElement(\"span\");\n+        icon.className = `treeview__icon treeview__icon--${Utils.sanitizeString(this.owner.getCardObjectTypeName())}`;\n+        listItem.appendChild(icon);\n+\n+        let title = document.createElement(\"span\");\n+        title.className = `treeview__title`;\n+        title.textContent = this.owner.getCardObjectTypeName();\n+        listItem.appendChild(title);\n+\n+        listItem.style.paddingLeft = `${indentationLevel * 20 + 24}px`;\n+        return listItem;\n+    }\n+\n+    updateLayout(): void {\n+        if (this.owner.isSelected) {\n+            this._listElement.classList.add(\"is-selected\");\n+        }\n+        else {\n+            this._listElement.classList.remove(\"is-selected\");\n+        }\n+    }\n+\n+    private foldTreeViewContainer(): void {\n+        this._isExpanded = !this._isExpanded;\n+        this._childContainerElement.classList.toggle(\"is-folded\")","path":"source/nodejs/adaptivecards-designer/src/components/treeitem.ts","position":93,"original_position":93,"commit_id":"5c72605d0a2fae20a2c5c23f86947e0ba7c5dc7c","original_commit_id":"76d34ee75f27873e41df60a2cf78164712321a7d","user":{"login":"dclaux","id":1334689,"node_id":"MDQ6VXNlcjEzMzQ2ODk=","avatar_url":"https://avatars1.githubusercontent.com/u/1334689?v=4","gravatar_id":"","url":"https://api.github.com/users/dclaux","html_url":"https://github.com/dclaux","followers_url":"https://api.github.com/users/dclaux/followers","following_url":"https://api.github.com/users/dclaux/following{/other_user}","gists_url":"https://api.github.com/users/dclaux/gists{/gist_id}","starred_url":"https://api.github.com/users/dclaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dclaux/subscriptions","organizations_url":"https://api.github.com/users/dclaux/orgs","repos_url":"https://api.github.com/users/dclaux/repos","events_url":"https://api.github.com/users/dclaux/events{/privacy}","received_events_url":"https://api.github.com/users/dclaux/received_events","type":"User","site_admin":false},"body":"I just learned about toggle thanks to this review. Cool!","created_at":"2018-07-10T16:52:55Z","updated_at":"2018-07-10T16:54:42Z","html_url":"https://github.com/Microsoft/AdaptiveCards/pull/1657#discussion_r201417677","pull_request_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/comments/201417677"},"html":{"href":"https://github.com/Microsoft/AdaptiveCards/pull/1657#discussion_r201417677"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657","id":198058820,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MDU4ODIw","html_url":"https://github.com/Microsoft/AdaptiveCards/pull/1657","diff_url":"https://github.com/Microsoft/AdaptiveCards/pull/1657.diff","patch_url":"https://github.com/Microsoft/AdaptiveCards/pull/1657.patch","issue_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues/1657","number":1657,"state":"open","locked":false,"title":"Plain Concepts’ PR with the Adaptive Cards designer first version. WIP","user":{"login":"IsmaelNavarro","id":10558907,"node_id":"MDQ6VXNlcjEwNTU4OTA3","avatar_url":"https://avatars2.githubusercontent.com/u/10558907?v=4","gravatar_id":"","url":"https://api.github.com/users/IsmaelNavarro","html_url":"https://github.com/IsmaelNavarro","followers_url":"https://api.github.com/users/IsmaelNavarro/followers","following_url":"https://api.github.com/users/IsmaelNavarro/following{/other_user}","gists_url":"https://api.github.com/users/IsmaelNavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/IsmaelNavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsmaelNavarro/subscriptions","organizations_url":"https://api.github.com/users/IsmaelNavarro/orgs","repos_url":"https://api.github.com/users/IsmaelNavarro/repos","events_url":"https://api.github.com/users/IsmaelNavarro/events{/privacy}","received_events_url":"https://api.github.com/users/IsmaelNavarro/received_events","type":"User","site_admin":false},"body":"[Functionality] Copy JSON\r\n[Functionality] Enter Full Screen\r\n[UI] + [Functionality] View tree view\r\n[UI] Top Nav\r\n[UI] Aside Left Menu\r\n[UI] Element properties\r\n[UI] Card\r\n[Functionality] Hide Menus\r\n[Functionality] Add hosts","created_at":"2018-06-28T14:58:33Z","updated_at":"2018-07-10T16:54:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef7210357574de6bf290528f1e5be02c699e1341","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657/commits","review_comments_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657/comments","review_comment_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues/1657/comments","statuses_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/statuses/5c72605d0a2fae20a2c5c23f86947e0ba7c5dc7c","head":{"label":"IsmaelNavarro:plain-concepts-wip","ref":"plain-concepts-wip","sha":"5c72605d0a2fae20a2c5c23f86947e0ba7c5dc7c","user":{"login":"IsmaelNavarro","id":10558907,"node_id":"MDQ6VXNlcjEwNTU4OTA3","avatar_url":"https://avatars2.githubusercontent.com/u/10558907?v=4","gravatar_id":"","url":"https://api.github.com/users/IsmaelNavarro","html_url":"https://github.com/IsmaelNavarro","followers_url":"https://api.github.com/users/IsmaelNavarro/followers","following_url":"https://api.github.com/users/IsmaelNavarro/following{/other_user}","gists_url":"https://api.github.com/users/IsmaelNavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/IsmaelNavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsmaelNavarro/subscriptions","organizations_url":"https://api.github.com/users/IsmaelNavarro/orgs","repos_url":"https://api.github.com/users/IsmaelNavarro/repos","events_url":"https://api.github.com/users/IsmaelNavarro/events{/privacy}","received_events_url":"https://api.github.com/users/IsmaelNavarro/received_events","type":"User","site_admin":false},"repo":{"id":136307073,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYzMDcwNzM=","name":"AdaptiveCards","full_name":"IsmaelNavarro/AdaptiveCards","owner":{"login":"IsmaelNavarro","id":10558907,"node_id":"MDQ6VXNlcjEwNTU4OTA3","avatar_url":"https://avatars2.githubusercontent.com/u/10558907?v=4","gravatar_id":"","url":"https://api.github.com/users/IsmaelNavarro","html_url":"https://github.com/IsmaelNavarro","followers_url":"https://api.github.com/users/IsmaelNavarro/followers","following_url":"https://api.github.com/users/IsmaelNavarro/following{/other_user}","gists_url":"https://api.github.com/users/IsmaelNavarro/gists{/gist_id}","starred_url":"https://api.github.com/users/IsmaelNavarro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IsmaelNavarro/subscriptions","organizations_url":"https://api.github.com/users/IsmaelNavarro/orgs","repos_url":"https://api.github.com/users/IsmaelNavarro/repos","events_url":"https://api.github.com/users/IsmaelNavarro/events{/privacy}","received_events_url":"https://api.github.com/users/IsmaelNavarro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/IsmaelNavarro/AdaptiveCards","description":"A new way for developers to exchange card content in a common and consistent way.","fork":true,"url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards","forks_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/forks","keys_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/teams","hooks_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/hooks","issue_events_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/issues/events{/number}","events_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/events","assignees_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/assignees{/user}","branches_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/branches{/branch}","tags_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/tags","blobs_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/git/refs{/sha}","trees_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/statuses/{sha}","languages_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/languages","stargazers_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/stargazers","contributors_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/contributors","subscribers_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/subscribers","subscription_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/subscription","commits_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/commits{/sha}","git_commits_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/git/commits{/sha}","comments_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/comments{/number}","issue_comment_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/issues/comments{/number}","contents_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/contents/{+path}","compare_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/merges","archive_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/downloads","issues_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/issues{/number}","pulls_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/pulls{/number}","milestones_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/milestones{/number}","notifications_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/labels{/name}","releases_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/releases{/id}","deployments_url":"https://api.github.com/repos/IsmaelNavarro/AdaptiveCards/deployments","created_at":"2018-06-06T09:39:38Z","updated_at":"2018-07-10T11:11:33Z","pushed_at":"2018-07-10T11:39:57Z","git_url":"git://github.com/IsmaelNavarro/AdaptiveCards.git","ssh_url":"git@github.com:IsmaelNavarro/AdaptiveCards.git","clone_url":"https://github.com/IsmaelNavarro/AdaptiveCards.git","svn_url":"https://github.com/IsmaelNavarro/AdaptiveCards","homepage":"http://adaptivecards.io","size":73011,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"84daf96875ebf45493a8088cbfcedb0d790c0a84","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":75978731,"node_id":"MDEwOlJlcG9zaXRvcnk3NTk3ODczMQ==","name":"AdaptiveCards","full_name":"Microsoft/AdaptiveCards","owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/AdaptiveCards","description":"A new way for developers to exchange card content in a common and consistent way.","fork":false,"url":"https://api.github.com/repos/Microsoft/AdaptiveCards","forks_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/forks","keys_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/teams","hooks_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/events","assignees_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/tags","blobs_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/languages","stargazers_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/subscription","commits_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/merges","archive_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/downloads","issues_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/AdaptiveCards/deployments","created_at":"2016-12-08T22:00:33Z","updated_at":"2018-07-09T20:13:06Z","pushed_at":"2018-07-10T11:39:59Z","git_url":"git://github.com/Microsoft/AdaptiveCards.git","ssh_url":"git@github.com:Microsoft/AdaptiveCards.git","clone_url":"https://github.com/Microsoft/AdaptiveCards.git","svn_url":"https://github.com/Microsoft/AdaptiveCards","homepage":"http://adaptivecards.io","size":72968,"stargazers_count":346,"watchers_count":346,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":85,"mirror_url":null,"archived":false,"open_issues_count":372,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":85,"open_issues":372,"watchers":346,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657"},"html":{"href":"https://github.com/Microsoft/AdaptiveCards/pull/1657"},"issue":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues/1657"},"comments":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/issues/1657/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/pulls/1657/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/AdaptiveCards/statuses/5c72605d0a2fae20a2c5c23f86947e0ba7c5dc7c"}},"author_association":"NONE"}}
{"actor":{"display_login":"dclaux"}}