GitHub PullRequestReviewCommentEvent at 2014-12-16 07:12:19
Repository: gaia
Actor: timdream
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/21881200","id":21881200,"diff_hunk":"@@ -54,19 +57,52 @@ LayoutPageView.prototype.render = function render() {\n       kbRow.classList.add('keyboard-last-row');\n     }\n \n-    row.forEach((function buildKeyboardColumns(key) {\n+    var keyCount = 0;\n+    var keyMap = new Map();\n+\n+    // Calculate the layout width for each row first.\n+    row.forEach(function calcRowRatio(key, keyIndex) {\n       var ratio = key.ratio || 1;\n       rowLayoutWidth += ratio;\n+    });\n+\n+    if ('handwritingPadOptions' in layout &&\n+        nrow < layout.handwritingPadOptions.rowspan) {\n+      rowLayoutWidth += layout.handwritingPadOptions.ratio;\n+    }\n+\n+    row.forEach((function buildKeyboardColumns(key, keyIndex) {\n+      var ratio = key.ratio || 1;\n \n       // One key in layout may be used to create multiple keyViews in\n       // different pages, so create a unique instance here.\n       var target = Object.freeze(Object.create(key));\n+\n       var options = {\n-        keyClassName: layout.keyClassName,\n+        classList: [],\n         outputChar: key.uppercaseValue,\n-        keyWidth: (placeHolderWidth * ratio)\n+        ratio: ratio\n       };\n \n+      if (layout.keyClassName) {\n+        options.classList = options.classList.concat(\n+          layout.keyClassName.split(' '));\n+      }\n+\n+      var layoutWidth = layout.width || 10;\n+      // Adjust the width of the first and the last key if there are less keys\n+      // in this row.\n+      if (layoutWidth != rowLayoutWidth) {\n+        var adjustedWidth = ratio + ((layoutWidth - rowLayoutWidth) / 2);\n+        if (keyIndex === 0) {\n+          options.classList.push('float-key-first');\n+          options.adjustedRatio = adjustedWidth;\n+        } else if (keyIndex === row.length - 1) {\n+          options.classList.push('float-key-last');","path":"apps/keyboard/js/views/layout_page_view.js","position":77,"original_position":77,"commit_id":"9832dc43076aabeaed4d8f81b48358d3e235afc3","original_commit_id":"9832dc43076aabeaed4d8f81b48358d3e235afc3","user":{"login":"timdream","id":93093,"avatar_url":"https://avatars.githubusercontent.com/u/93093?v=3","gravatar_id":"","url":"https://api.github.com/users/timdream","html_url":"https://github.com/timdream","followers_url":"https://api.github.com/users/timdream/followers","following_url":"https://api.github.com/users/timdream/following{/other_user}","gists_url":"https://api.github.com/users/timdream/gists{/gist_id}","starred_url":"https://api.github.com/users/timdream/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timdream/subscriptions","organizations_url":"https://api.github.com/users/timdream/orgs","repos_url":"https://api.github.com/users/timdream/repos","events_url":"https://api.github.com/users/timdream/events{/privacy}","received_events_url":"https://api.github.com/users/timdream/received_events","type":"User","site_admin":false},"body":"Like wise, you can remove this className with `:last-child` in CSS.","created_at":"2014-12-16T07:12:19Z","updated_at":"2014-12-16T07:12:19Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/26781#discussion_r21881200","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/21881200"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/26781#discussion_r21881200"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781","id":26062577,"html_url":"https://github.com/mozilla-b2g/gaia/pull/26781","diff_url":"https://github.com/mozilla-b2g/gaia/pull/26781.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/26781.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26781","number":26781,"state":"open","locked":false,"title":"Bug 1105178 - Separate resize out to LayoutPageView.  - Use flex box to layout","user":{"login":"RudyLu","id":1704629,"avatar_url":"https://avatars.githubusercontent.com/u/1704629?v=3","gravatar_id":"","url":"https://api.github.com/users/RudyLu","html_url":"https://github.com/RudyLu","followers_url":"https://api.github.com/users/RudyLu/followers","following_url":"https://api.github.com/users/RudyLu/following{/other_user}","gists_url":"https://api.github.com/users/RudyLu/gists{/gist_id}","starred_url":"https://api.github.com/users/RudyLu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RudyLu/subscriptions","organizations_url":"https://api.github.com/users/RudyLu/orgs","repos_url":"https://api.github.com/users/RudyLu/repos","events_url":"https://api.github.com/users/RudyLu/events{/privacy}","received_events_url":"https://api.github.com/users/RudyLu/received_events","type":"User","site_admin":false},"body":"the keyboard.","created_at":"2014-12-15T11:27:51Z","updated_at":"2014-12-16T07:12:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9908f2c7871e72452ded9c380a41e8baf4721ee0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26781/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/9832dc43076aabeaed4d8f81b48358d3e235afc3","head":{"label":"RudyLu:keyboard/Bug1105178-move_resize_out_2","ref":"keyboard/Bug1105178-move_resize_out_2","sha":"9832dc43076aabeaed4d8f81b48358d3e235afc3","user":{"login":"RudyLu","id":1704629,"avatar_url":"https://avatars.githubusercontent.com/u/1704629?v=3","gravatar_id":"","url":"https://api.github.com/users/RudyLu","html_url":"https://github.com/RudyLu","followers_url":"https://api.github.com/users/RudyLu/followers","following_url":"https://api.github.com/users/RudyLu/following{/other_user}","gists_url":"https://api.github.com/users/RudyLu/gists{/gist_id}","starred_url":"https://api.github.com/users/RudyLu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RudyLu/subscriptions","organizations_url":"https://api.github.com/users/RudyLu/orgs","repos_url":"https://api.github.com/users/RudyLu/repos","events_url":"https://api.github.com/users/RudyLu/events{/privacy}","received_events_url":"https://api.github.com/users/RudyLu/received_events","type":"User","site_admin":false},"repo":{"id":4223338,"name":"gaia","full_name":"RudyLu/gaia","owner":{"login":"RudyLu","id":1704629,"avatar_url":"https://avatars.githubusercontent.com/u/1704629?v=3","gravatar_id":"","url":"https://api.github.com/users/RudyLu","html_url":"https://github.com/RudyLu","followers_url":"https://api.github.com/users/RudyLu/followers","following_url":"https://api.github.com/users/RudyLu/following{/other_user}","gists_url":"https://api.github.com/users/RudyLu/gists{/gist_id}","starred_url":"https://api.github.com/users/RudyLu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RudyLu/subscriptions","organizations_url":"https://api.github.com/users/RudyLu/orgs","repos_url":"https://api.github.com/users/RudyLu/repos","events_url":"https://api.github.com/users/RudyLu/events{/privacy}","received_events_url":"https://api.github.com/users/RudyLu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RudyLu/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project","fork":true,"url":"https://api.github.com/repos/RudyLu/gaia","forks_url":"https://api.github.com/repos/RudyLu/gaia/forks","keys_url":"https://api.github.com/repos/RudyLu/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RudyLu/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RudyLu/gaia/teams","hooks_url":"https://api.github.com/repos/RudyLu/gaia/hooks","issue_events_url":"https://api.github.com/repos/RudyLu/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/RudyLu/gaia/events","assignees_url":"https://api.github.com/repos/RudyLu/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/RudyLu/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/RudyLu/gaia/tags","blobs_url":"https://api.github.com/repos/RudyLu/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RudyLu/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RudyLu/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/RudyLu/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RudyLu/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/RudyLu/gaia/languages","stargazers_url":"https://api.github.com/repos/RudyLu/gaia/stargazers","contributors_url":"https://api.github.com/repos/RudyLu/gaia/contributors","subscribers_url":"https://api.github.com/repos/RudyLu/gaia/subscribers","subscription_url":"https://api.github.com/repos/RudyLu/gaia/subscription","commits_url":"https://api.github.com/repos/RudyLu/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/RudyLu/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/RudyLu/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/RudyLu/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/RudyLu/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/RudyLu/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RudyLu/gaia/merges","archive_url":"https://api.github.com/repos/RudyLu/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RudyLu/gaia/downloads","issues_url":"https://api.github.com/repos/RudyLu/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/RudyLu/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/RudyLu/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/RudyLu/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RudyLu/gaia/labels{/name}","releases_url":"https://api.github.com/repos/RudyLu/gaia/releases{/id}","created_at":"2012-05-04T09:25:49Z","updated_at":"2014-08-05T03:56:20Z","pushed_at":"2014-12-15T11:27:38Z","git_url":"git://github.com/RudyLu/gaia.git","ssh_url":"git@github.com:RudyLu/gaia.git","clone_url":"https://github.com/RudyLu/gaia.git","svn_url":"https://github.com/RudyLu/gaia","homepage":"https://wiki.mozilla.org/B2G","size":883719,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"457e94636b74516e10abc1da026ce2b622713d95","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments/{number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2014-12-16T06:55:24Z","pushed_at":"2014-12-16T06:55:23Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1347221,"stargazers_count":1825,"watchers_count":1825,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2110,"mirror_url":null,"open_issues_count":746,"forks":2110,"open_issues":746,"watchers":1825,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/26781"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26781"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/26781/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/26781/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/9832dc43076aabeaed4d8f81b48358d3e235afc3"}}}}