{"action":"created","comment":{"url":"https://api.github.com/repos/binary-com/binary-static/pulls/comments/43710908","id":43710908,"diff_hunk":"@@ -0,0 +1,58 @@\n+\n+var ViewBalanceUI = (function(){\n+    var colsName = [\"loginid\", \"currency\", \"balance\"];\n+\n+    function createEmptyBalanceTable(){\n+        var header = [\n+            Content.localize().textLoginID,\n+            Content.localize().textCurrency,\n+            Content.localize().textBalance\n+        ];\n+        var metadata = {\n+            cols: colsName,\n+            id: \"bal-table\"\n+        };\n+        var data = [];\n+        var $table = Table.createFlexTable(data, metadata, header);\n+\n+        return $table;\n+    }\n+\n+    function createBalancePopup(){\n+        var $popupDiv = $(\"<div></div>\", {class: \"popup-div\", id: \"balance-container\"});\n+        var $balTitle = $(\"<h1></h1>\", {text: Content.localize().textBalances});\n+        var $br = $(\"<br>\");\n+        var $table = createEmptyBalanceTable();\n+\n+        var $span = $(\"<span></span>\", {class: \"button\"});\n+        var $button = $(\"<button></button>\", {\n+            class: \"button\",\n+            id: \"close-balances\",\n+            text:Content.localize().textContinueTrading\n+        });\n+        $span.append($button);\n+\n+        $popupDiv.append($balTitle).append($br).append($table).append($span);","path":"src/javascript/binary/static/viewbalance/viewbalance.ui.js","position":35,"original_position":35,"commit_id":"1233d746e0e2159884baeb7f91d3c5a9ac32dc02","original_commit_id":"1233d746e0e2159884baeb7f91d3c5a9ac32dc02","user":{"login":"qingweibinary","id":14971922,"avatar_url":"https://avatars.githubusercontent.com/u/14971922?v=3","gravatar_id":"","url":"https://api.github.com/users/qingweibinary","html_url":"https://github.com/qingweibinary","followers_url":"https://api.github.com/users/qingweibinary/followers","following_url":"https://api.github.com/users/qingweibinary/following{/other_user}","gists_url":"https://api.github.com/users/qingweibinary/gists{/gist_id}","starred_url":"https://api.github.com/users/qingweibinary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingweibinary/subscriptions","organizations_url":"https://api.github.com/users/qingweibinary/orgs","repos_url":"https://api.github.com/users/qingweibinary/repos","events_url":"https://api.github.com/users/qingweibinary/events{/privacy}","received_events_url":"https://api.github.com/users/qingweibinary/received_events","type":"User","site_admin":false},"body":"@raunak-binary \r\n\r\nI was wrong, JQuery does use Document Fragment, when you passed in an array but not in loops, so not relevant in the code here\r\n\r\nBut I think if DocFragment helps because it delay reflow, a detached DOM (which is used here) should serve the same purpose, because reflow only happens when we append to the view\r\n\r\nOne of the answer here have similar opinion, what do you think?\r\nhttp://stackoverflow.com/questions/14615484/does-jquery-use-create-document-fragment-inside-each-loops\r\n\r\nI am reluctant to change as documentFragment API does not accept JQuery object out of the box, haha","created_at":"2015-11-03T02:30:15Z","updated_at":"2015-11-03T02:30:15Z","html_url":"https://github.com/binary-com/binary-static/pull/580#discussion_r43710908","pull_request_url":"https://api.github.com/repos/binary-com/binary-static/pulls/580","_links":{"self":{"href":"https://api.github.com/repos/binary-com/binary-static/pulls/comments/43710908"},"html":{"href":"https://github.com/binary-com/binary-static/pull/580#discussion_r43710908"},"pull_request":{"href":"https://api.github.com/repos/binary-com/binary-static/pulls/580"}}},"pull_request":{"url":"https://api.github.com/repos/binary-com/binary-static/pulls/580","id":48152805,"html_url":"https://github.com/binary-com/binary-static/pull/580","diff_url":"https://github.com/binary-com/binary-static/pull/580.diff","patch_url":"https://github.com/binary-com/binary-static/pull/580.patch","issue_url":"https://api.github.com/repos/binary-com/binary-static/issues/580","number":580,"state":"open","locked":false,"title":"Qingwei/view balance ws","user":{"login":"qingweibinary","id":14971922,"avatar_url":"https://avatars.githubusercontent.com/u/14971922?v=3","gravatar_id":"","url":"https://api.github.com/users/qingweibinary","html_url":"https://github.com/qingweibinary","followers_url":"https://api.github.com/users/qingweibinary/followers","following_url":"https://api.github.com/users/qingweibinary/following{/other_user}","gists_url":"https://api.github.com/users/qingweibinary/gists{/gist_id}","starred_url":"https://api.github.com/users/qingweibinary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingweibinary/subscriptions","organizations_url":"https://api.github.com/users/qingweibinary/orgs","repos_url":"https://api.github.com/users/qingweibinary/repos","events_url":"https://api.github.com/users/qingweibinary/events{/privacy}","received_events_url":"https://api.github.com/users/qingweibinary/received_events","type":"User","site_admin":false},"body":"The view balance popup are depending on Websocket data now, and responsiveness is added\r\n","created_at":"2015-10-20T03:23:07Z","updated_at":"2015-11-03T02:30:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c924d0866da6abde496019eab7fa7cdf2cfef8b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/binary-com/binary-static/pulls/580/commits","review_comments_url":"https://api.github.com/repos/binary-com/binary-static/pulls/580/comments","review_comment_url":"https://api.github.com/repos/binary-com/binary-static/pulls/comments{/number}","comments_url":"https://api.github.com/repos/binary-com/binary-static/issues/580/comments","statuses_url":"https://api.github.com/repos/binary-com/binary-static/statuses/1233d746e0e2159884baeb7f91d3c5a9ac32dc02","head":{"label":"qingweibinary:qingwei/view_balance_ws","ref":"qingwei/view_balance_ws","sha":"1233d746e0e2159884baeb7f91d3c5a9ac32dc02","user":{"login":"qingweibinary","id":14971922,"avatar_url":"https://avatars.githubusercontent.com/u/14971922?v=3","gravatar_id":"","url":"https://api.github.com/users/qingweibinary","html_url":"https://github.com/qingweibinary","followers_url":"https://api.github.com/users/qingweibinary/followers","following_url":"https://api.github.com/users/qingweibinary/following{/other_user}","gists_url":"https://api.github.com/users/qingweibinary/gists{/gist_id}","starred_url":"https://api.github.com/users/qingweibinary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingweibinary/subscriptions","organizations_url":"https://api.github.com/users/qingweibinary/orgs","repos_url":"https://api.github.com/users/qingweibinary/repos","events_url":"https://api.github.com/users/qingweibinary/events{/privacy}","received_events_url":"https://api.github.com/users/qingweibinary/received_events","type":"User","site_admin":false},"repo":{"id":43669013,"name":"binary-static","full_name":"qingweibinary/binary-static","owner":{"login":"qingweibinary","id":14971922,"avatar_url":"https://avatars.githubusercontent.com/u/14971922?v=3","gravatar_id":"","url":"https://api.github.com/users/qingweibinary","html_url":"https://github.com/qingweibinary","followers_url":"https://api.github.com/users/qingweibinary/followers","following_url":"https://api.github.com/users/qingweibinary/following{/other_user}","gists_url":"https://api.github.com/users/qingweibinary/gists{/gist_id}","starred_url":"https://api.github.com/users/qingweibinary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qingweibinary/subscriptions","organizations_url":"https://api.github.com/users/qingweibinary/orgs","repos_url":"https://api.github.com/users/qingweibinary/repos","events_url":"https://api.github.com/users/qingweibinary/events{/privacy}","received_events_url":"https://api.github.com/users/qingweibinary/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qingweibinary/binary-static","description":"Binary.com static content","fork":true,"url":"https://api.github.com/repos/qingweibinary/binary-static","forks_url":"https://api.github.com/repos/qingweibinary/binary-static/forks","keys_url":"https://api.github.com/repos/qingweibinary/binary-static/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qingweibinary/binary-static/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qingweibinary/binary-static/teams","hooks_url":"https://api.github.com/repos/qingweibinary/binary-static/hooks","issue_events_url":"https://api.github.com/repos/qingweibinary/binary-static/issues/events{/number}","events_url":"https://api.github.com/repos/qingweibinary/binary-static/events","assignees_url":"https://api.github.com/repos/qingweibinary/binary-static/assignees{/user}","branches_url":"https://api.github.com/repos/qingweibinary/binary-static/branches{/branch}","tags_url":"https://api.github.com/repos/qingweibinary/binary-static/tags","blobs_url":"https://api.github.com/repos/qingweibinary/binary-static/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qingweibinary/binary-static/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qingweibinary/binary-static/git/refs{/sha}","trees_url":"https://api.github.com/repos/qingweibinary/binary-static/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qingweibinary/binary-static/statuses/{sha}","languages_url":"https://api.github.com/repos/qingweibinary/binary-static/languages","stargazers_url":"https://api.github.com/repos/qingweibinary/binary-static/stargazers","contributors_url":"https://api.github.com/repos/qingweibinary/binary-static/contributors","subscribers_url":"https://api.github.com/repos/qingweibinary/binary-static/subscribers","subscription_url":"https://api.github.com/repos/qingweibinary/binary-static/subscription","commits_url":"https://api.github.com/repos/qingweibinary/binary-static/commits{/sha}","git_commits_url":"https://api.github.com/repos/qingweibinary/binary-static/git/commits{/sha}","comments_url":"https://api.github.com/repos/qingweibinary/binary-static/comments{/number}","issue_comment_url":"https://api.github.com/repos/qingweibinary/binary-static/issues/comments{/number}","contents_url":"https://api.github.com/repos/qingweibinary/binary-static/contents/{+path}","compare_url":"https://api.github.com/repos/qingweibinary/binary-static/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qingweibinary/binary-static/merges","archive_url":"https://api.github.com/repos/qingweibinary/binary-static/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qingweibinary/binary-static/downloads","issues_url":"https://api.github.com/repos/qingweibinary/binary-static/issues{/number}","pulls_url":"https://api.github.com/repos/qingweibinary/binary-static/pulls{/number}","milestones_url":"https://api.github.com/repos/qingweibinary/binary-static/milestones{/number}","notifications_url":"https://api.github.com/repos/qingweibinary/binary-static/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qingweibinary/binary-static/labels{/name}","releases_url":"https://api.github.com/repos/qingweibinary/binary-static/releases{/id}","created_at":"2015-10-05T06:40:32Z","updated_at":"2015-10-05T06:40:58Z","pushed_at":"2015-11-02T09:06:07Z","git_url":"git://github.com/qingweibinary/binary-static.git","ssh_url":"git@github.com:qingweibinary/binary-static.git","clone_url":"https://github.com/qingweibinary/binary-static.git","svn_url":"https://github.com/qingweibinary/binary-static","homepage":null,"size":287379,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"binary-com:master","ref":"master","sha":"4208224f90e62719491a7b4ad1d3c408b9d4d5af","user":{"login":"binary-com","id":7437559,"avatar_url":"https://avatars.githubusercontent.com/u/7437559?v=3","gravatar_id":"","url":"https://api.github.com/users/binary-com","html_url":"https://github.com/binary-com","followers_url":"https://api.github.com/users/binary-com/followers","following_url":"https://api.github.com/users/binary-com/following{/other_user}","gists_url":"https://api.github.com/users/binary-com/gists{/gist_id}","starred_url":"https://api.github.com/users/binary-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary-com/subscriptions","organizations_url":"https://api.github.com/users/binary-com/orgs","repos_url":"https://api.github.com/users/binary-com/repos","events_url":"https://api.github.com/users/binary-com/events{/privacy}","received_events_url":"https://api.github.com/users/binary-com/received_events","type":"Organization","site_admin":false},"repo":{"id":21266373,"name":"binary-static","full_name":"binary-com/binary-static","owner":{"login":"binary-com","id":7437559,"avatar_url":"https://avatars.githubusercontent.com/u/7437559?v=3","gravatar_id":"","url":"https://api.github.com/users/binary-com","html_url":"https://github.com/binary-com","followers_url":"https://api.github.com/users/binary-com/followers","following_url":"https://api.github.com/users/binary-com/following{/other_user}","gists_url":"https://api.github.com/users/binary-com/gists{/gist_id}","starred_url":"https://api.github.com/users/binary-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binary-com/subscriptions","organizations_url":"https://api.github.com/users/binary-com/orgs","repos_url":"https://api.github.com/users/binary-com/repos","events_url":"https://api.github.com/users/binary-com/events{/privacy}","received_events_url":"https://api.github.com/users/binary-com/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/binary-com/binary-static","description":"Binary.com static content","fork":false,"url":"https://api.github.com/repos/binary-com/binary-static","forks_url":"https://api.github.com/repos/binary-com/binary-static/forks","keys_url":"https://api.github.com/repos/binary-com/binary-static/keys{/key_id}","collaborators_url":"https://api.github.com/repos/binary-com/binary-static/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/binary-com/binary-static/teams","hooks_url":"https://api.github.com/repos/binary-com/binary-static/hooks","issue_events_url":"https://api.github.com/repos/binary-com/binary-static/issues/events{/number}","events_url":"https://api.github.com/repos/binary-com/binary-static/events","assignees_url":"https://api.github.com/repos/binary-com/binary-static/assignees{/user}","branches_url":"https://api.github.com/repos/binary-com/binary-static/branches{/branch}","tags_url":"https://api.github.com/repos/binary-com/binary-static/tags","blobs_url":"https://api.github.com/repos/binary-com/binary-static/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/binary-com/binary-static/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/binary-com/binary-static/git/refs{/sha}","trees_url":"https://api.github.com/repos/binary-com/binary-static/git/trees{/sha}","statuses_url":"https://api.github.com/repos/binary-com/binary-static/statuses/{sha}","languages_url":"https://api.github.com/repos/binary-com/binary-static/languages","stargazers_url":"https://api.github.com/repos/binary-com/binary-static/stargazers","contributors_url":"https://api.github.com/repos/binary-com/binary-static/contributors","subscribers_url":"https://api.github.com/repos/binary-com/binary-static/subscribers","subscription_url":"https://api.github.com/repos/binary-com/binary-static/subscription","commits_url":"https://api.github.com/repos/binary-com/binary-static/commits{/sha}","git_commits_url":"https://api.github.com/repos/binary-com/binary-static/git/commits{/sha}","comments_url":"https://api.github.com/repos/binary-com/binary-static/comments{/number}","issue_comment_url":"https://api.github.com/repos/binary-com/binary-static/issues/comments{/number}","contents_url":"https://api.github.com/repos/binary-com/binary-static/contents/{+path}","compare_url":"https://api.github.com/repos/binary-com/binary-static/compare/{base}...{head}","merges_url":"https://api.github.com/repos/binary-com/binary-static/merges","archive_url":"https://api.github.com/repos/binary-com/binary-static/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/binary-com/binary-static/downloads","issues_url":"https://api.github.com/repos/binary-com/binary-static/issues{/number}","pulls_url":"https://api.github.com/repos/binary-com/binary-static/pulls{/number}","milestones_url":"https://api.github.com/repos/binary-com/binary-static/milestones{/number}","notifications_url":"https://api.github.com/repos/binary-com/binary-static/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/binary-com/binary-static/labels{/name}","releases_url":"https://api.github.com/repos/binary-com/binary-static/releases{/id}","created_at":"2014-06-27T06:34:22Z","updated_at":"2015-09-04T05:05:19Z","pushed_at":"2015-11-03T02:22:52Z","git_url":"git://github.com/binary-com/binary-static.git","ssh_url":"git@github.com:binary-com/binary-static.git","clone_url":"https://github.com/binary-com/binary-static.git","svn_url":"https://github.com/binary-com/binary-static","homepage":null,"size":297919,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":11,"forks":57,"open_issues":11,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/binary-com/binary-static/pulls/580"},"html":{"href":"https://github.com/binary-com/binary-static/pull/580"},"issue":{"href":"https://api.github.com/repos/binary-com/binary-static/issues/580"},"comments":{"href":"https://api.github.com/repos/binary-com/binary-static/issues/580/comments"},"review_comments":{"href":"https://api.github.com/repos/binary-com/binary-static/pulls/580/comments"},"review_comment":{"href":"https://api.github.com/repos/binary-com/binary-static/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/binary-com/binary-static/pulls/580/commits"},"statuses":{"href":"https://api.github.com/repos/binary-com/binary-static/statuses/1233d746e0e2159884baeb7f91d3c5a9ac32dc02"}}}}