GitHub PullRequestReviewCommentEvent at 2014-03-06 18:28:03
Repository: SlickGrid
Actor: SimpleAsCouldBe
Payload: {"comment":{"url":"https://api.github.com/repos/mleibman/SlickGrid/pulls/comments/10353543","id":10353543,"diff_hunk":"@@ -860,9 +865,68 @@ if (typeof Slick === \"undefined\") {\n               updateCanvasWidth(true);\r\n               render();\r\n               trigger(self.onColumnsResized, {});\r\n+            })\r\n+\t\t\t.bind(\"dblclick\", function(e){\r\n+                var columnId = $($(this).parent()).attr('id').replace(uid,'');\r\n+                for(var j = 0; j < columns.length; j++){\r\n+                    if(columns[j].id == columnId){\r\n+                        var aux_width = calculateWordDimensions(columnElements[i].children[0].innerHTML).width;\r\n+                        if(columns[j].values != undefined && columns[j].values.length > 0){\r\n+                            for(var k = 0; k < columns[j].values.length; k++){\r\n+                                if(calculateWordDimensions(columns[j].values[k].Description.toString()).width > aux_width){\r\n+                                    aux_width = calculateWordDimensions(columns[j].values[k].Description.toString()).width;\r\n+                                }\r\n+                            }\r\n+                        }else{\r\n+                            var data_col = $.map(data instanceof Array ? data : data.getItems(),function(e){\r\n+                                return e[columnId];\r\n+                            });\r\n+                            for(var k = 0; k < data_col.length; k++){\r\n+                                if(calculateWordDimensions(data_col[k].toString()).width > aux_width){\r\n+                                    aux_width = calculateWordDimensions(data_col[k].toString()).width;\r\n+                                }\r\n+                            }\r\n+                        }\r\n+                        columns[j].width = aux_width;\r\n+                        break;\r\n+                    }\r\n+                }\r\n+                applyColumnHeaderWidths();\r\n+                updateCanvasWidth(true);\r\n+                render();\r\n+                trigger(self.onColumnsResized, {});\r\n             });\r\n       });\r\n     }\r\n+\t\r\n+\tfunction calculateWordDimensions(text, escape){\r\n+        if (escape === undefined) {\r\n+            escape = true;\r\n+        }\r\n+\r\n+        var div = document.createElement('div');\r\n+\t\t$(div).css({'position':'absolute','visibility':'hidden',\r\n+\t\t\t\t\t'height':'auto','width':'auto',\r\n+\t\t\t\t\t'white-space':'nowrap','font-family':'Verdana, Arial, sans-serif',\r\n+\t\t\t\t\t'font-size':'13px','border':'1px solid transparent',\r\n+\t\t\t\t\t'padding':'1px 4px 2px'})\r\n+        if (escape) {\r\n+            $(div).text(text);\r\n+        } else {\r\n+            div.innerHTML = text;\r\n+        }\r\n+\r\n+        document.body.appendChild(div);\r\n+\r\n+        var dimensions = {\r\n+            width : jQuery(div).outerWidth() + 30,\r","path":"slick.grid.js","position":82,"original_position":82,"commit_id":"9b21e23befe97408ee8ba477cef4197df4f77480","original_commit_id":"9b21e23befe97408ee8ba477cef4197df4f77480","user":{"login":"SimpleAsCouldBe","id":548809,"avatar_url":"https://gravatar.com/avatar/406e9e44c15b99307c593042a728e929?d=https%3A%2F%2Fidenticons.github.com%2Ffc0219870ad0ea36be5d8995399af9dc.png&r=x","gravatar_id":"406e9e44c15b99307c593042a728e929","url":"https://api.github.com/users/SimpleAsCouldBe","html_url":"https://github.com/SimpleAsCouldBe","followers_url":"https://api.github.com/users/SimpleAsCouldBe/followers","following_url":"https://api.github.com/users/SimpleAsCouldBe/following{/other_user}","gists_url":"https://api.github.com/users/SimpleAsCouldBe/gists{/gist_id}","starred_url":"https://api.github.com/users/SimpleAsCouldBe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimpleAsCouldBe/subscriptions","organizations_url":"https://api.github.com/users/SimpleAsCouldBe/orgs","repos_url":"https://api.github.com/users/SimpleAsCouldBe/repos","events_url":"https://api.github.com/users/SimpleAsCouldBe/events{/privacy}","received_events_url":"https://api.github.com/users/SimpleAsCouldBe/received_events","type":"User","site_admin":false},"body":"+30?","created_at":"2014-03-06T18:28:03Z","updated_at":"2014-03-06T18:28:03Z","html_url":"https://github.com/mleibman/SlickGrid/pull/733#discussion_r10353543","pull_request_url":"https://api.github.com/repos/mleibman/SlickGrid/pulls/733","_links":{"self":{"href":"https://api.github.com/repos/mleibman/SlickGrid/pulls/comments/10353543"},"html":{"href":"https://github.com/mleibman/SlickGrid/pull/733#discussion_r10353543"},"pull_request":{"href":"https://api.github.com/repos/mleibman/SlickGrid/pulls/733"}}}}