{"action":"created","comment":{"url":"https://api.github.com/repos/Addepar/ember-table/pulls/comments/29678753","id":29678753,"diff_hunk":"@@ -0,0 +1,148 @@\n+import Ember from 'ember';\n+import StyleBindingsMixin from 'ember-table/mixins/style-bindings';\n+import RegisterTableComponentMixin from 'ember-table/mixins/register-table-component';\n+\n+export default Ember.View.extend(\n+StyleBindingsMixin, RegisterTableComponentMixin, {\n+  // ---------------------------------------------------------------------------\n+  // API - Inputs\n+  // ---------------------------------------------------------------------------\n+\n+  // TODO: Doc\n+  templateName: 'header-cell',\n+  classNames: ['ember-table-cell', 'ember-table-header-cell'],\n+  classNameBindings: ['column.isSortable:sortable', 'column.textAlign'],\n+  styleBindings: ['width', 'height'],\n+\n+  // ---------------------------------------------------------------------------\n+  // Internal properties\n+  // ---------------------------------------------------------------------------\n+\n+  column: Ember.computed.alias('content'),\n+  width: Ember.computed.alias('column.width'),\n+  minWidth: Ember.computed.alias('column.minWidth'),\n+  maxWidth: Ember.computed.alias('column.maxWidth'),\n+  nextResizableColumn: Ember.computed.alias('column.nextResizableColumn'),\n+  height: Ember.computed.alias('tableComponent._headerHeight'),\n+\n+  effectiveMinWidth: Ember.computed(function() {\n+    if (this.get('tableComponent.columnMode') === 'standard') {\n+      return this.get('minWidth');\n+    }\n+    var nextColumnMaxDiff = this.get('nextResizableColumn.maxWidth') -\n+        this.get('nextResizableColumn.width');\n+    if (this.get('minWidth') && nextColumnMaxDiff) {\n+      return Math.min(this.get('minWidth'), this.get('width') -\n+          nextColumnMaxDiff);\n+    } else if (this.get('minWidth')) {\n+      return this.get('minWidth');\n+    } else {\n+      return this.get('width') - nextColumnMaxDiff;\n+    }\n+  }).property('width', 'minWidth', 'tableComponent.columnMode',\n+      'nextResizableColumn.{width,maxWidth}'),\n+\n+  effectiveMaxWidth: Ember.computed(function() {\n+    if (this.get('tableComponent.columnMode') === 'standard') {\n+      return this.get('maxWidth');\n+    }\n+    var nextColumnMaxDiff = this.get('nextResizableColumn.width') -\n+        this.get('nextResizableColumn.minWidth');\n+    if (this.get('maxWidth') && !Ember.isNone(nextColumnMaxDiff)) {\n+      return Math.min(this.get('maxWidth'), this.get('width') +\n+          nextColumnMaxDiff);\n+    } else if (this.get('maxWidth')) {\n+      return this.get('maxWidth');\n+    } else {\n+      return this.get('width') + nextColumnMaxDiff;\n+    }\n+  }).property('width', 'minWidth', 'tableComponent.columnMode',\n+      'nextResizableColumn.{width,minWidth}'),\n+\n+  // jQuery UI resizable option\n+  resizableOption: Ember.computed(function() {\n+    return {\n+      handles: 'e',\n+      // We need about 10px as absolute minimums for the columns\n+      minWidth: Math.max(this.get('effectiveMinWidth') || 0, 10),\n+      maxWidth: this.get('effectiveMaxWidth'),\n+      // TODO(azirbel): This is unexpected and needs documentation or removal\n+      grid: this.get('column.snapGrid'),\n+      resize: Ember.$.proxy(this.onColumnResize, this),\n+      stop: Ember.$.proxy(this.onColumnResize, this)\n+    };\n+  }).property('effectiveMinWidth', 'effectiveMaxWidth'),\n+\n+  didInsertElement: function() {\n+    this.elementSizeDidChange();\n+    this.recomputeResizableHandle();\n+  },\n+\n+  willDestroyElement: function() {\n+    if (this.$().is('.ui-resizable')) {\n+      this.$().resizable('destroy');\n+    }\n+    this._super();\n+  },\n+\n+  _isResizable: Ember.computed(function() {\n+    if (this.get('tableComponent.columnMode') === 'standard') {\n+      return this.get('column.isResizable');\n+    } else {\n+      return this.get('column.isResizable') && this.get('nextResizableColumn');\n+    }\n+  }).property('column.isResizable', 'tableComponent.columnMode',\n+      'nextResizableColumn'),\n+\n+  // `event` here is a jQuery event\n+  onColumnResize: function(event, ui) {\n+    var newWidth = Math.round(ui.size.width);\n+    if (this.get('tableComponent.columnMode') === 'standard') {\n+      this.get('column').resize(newWidth);\n+      this.set('tableComponent.columnsFillTable', false);\n+    } else {\n+      var diff = this.get('width') - newWidth;\n+      this.get('column').resize(newWidth);\n+      this.get('nextResizableColumn').resize(\n+          this.get('nextResizableColumn.width') + diff);\n+    }\n+\n+    this.elementSizeDidChange();\n+\n+    // Trigger the table resize (and redraw of layout) when resizing is done\n+    if (event.type === 'resizestop') {\n+      this.get('tableComponent').elementSizeDidChange();\n+    }\n+  },\n+\n+  elementSizeDidChange: function() {\n+    var maxHeight = 0;\n+    // TODO(Louis): This seems bad...\n+    Ember.$('.ember-table-header-block .ember-table-content').each(function() {\n+      var thisHeight = Ember.$(this).outerHeight();\n+      if (thisHeight > maxHeight) {\n+        return maxHeight = thisHeight;\n+      }\n+    });\n+    return this.set('tableComponent._contentHeaderHeight', maxHeight);\n+  },\n+\n+  cellWidthDidChange: Ember.observer(function() {\n+    return Ember.run.schedule('afterRender', this, this.elementSizeDidChange);","path":"addon/views/header-cell.js","position":131,"original_position":131,"commit_id":"b55a30aef41bea1b0c4e9ffa31e2c7b40039a581","original_commit_id":"b55a30aef41bea1b0c4e9ffa31e2c7b40039a581","user":{"login":"cyril-sf","id":743977,"avatar_url":"https://avatars.githubusercontent.com/u/743977?v=3","gravatar_id":"","url":"https://api.github.com/users/cyril-sf","html_url":"https://github.com/cyril-sf","followers_url":"https://api.github.com/users/cyril-sf/followers","following_url":"https://api.github.com/users/cyril-sf/following{/other_user}","gists_url":"https://api.github.com/users/cyril-sf/gists{/gist_id}","starred_url":"https://api.github.com/users/cyril-sf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyril-sf/subscriptions","organizations_url":"https://api.github.com/users/cyril-sf/orgs","repos_url":"https://api.github.com/users/cyril-sf/repos","events_url":"https://api.github.com/users/cyril-sf/events{/privacy}","received_events_url":"https://api.github.com/users/cyril-sf/received_events","type":"User","site_admin":false},"body":"`return` is not needed","created_at":"2015-05-05T15:19:03Z","updated_at":"2015-05-05T15:19:03Z","html_url":"https://github.com/Addepar/ember-table/pull/309#discussion_r29678753","pull_request_url":"https://api.github.com/repos/Addepar/ember-table/pulls/309","_links":{"self":{"href":"https://api.github.com/repos/Addepar/ember-table/pulls/comments/29678753"},"html":{"href":"https://github.com/Addepar/ember-table/pull/309#discussion_r29678753"},"pull_request":{"href":"https://api.github.com/repos/Addepar/ember-table/pulls/309"}}},"pull_request":{"url":"https://api.github.com/repos/Addepar/ember-table/pulls/309","id":34666546,"html_url":"https://github.com/Addepar/ember-table/pull/309","diff_url":"https://github.com/Addepar/ember-table/pull/309.diff","patch_url":"https://github.com/Addepar/ember-table/pull/309.patch","issue_url":"https://api.github.com/repos/Addepar/ember-table/issues/309","number":309,"state":"open","locked":false,"title":"Convert to an Ember CLI addon","user":{"login":"azirbel","id":498245,"avatar_url":"https://avatars.githubusercontent.com/u/498245?v=3","gravatar_id":"","url":"https://api.github.com/users/azirbel","html_url":"https://github.com/azirbel","followers_url":"https://api.github.com/users/azirbel/followers","following_url":"https://api.github.com/users/azirbel/following{/other_user}","gists_url":"https://api.github.com/users/azirbel/gists{/gist_id}","starred_url":"https://api.github.com/users/azirbel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azirbel/subscriptions","organizations_url":"https://api.github.com/users/azirbel/orgs","repos_url":"https://api.github.com/users/azirbel/repos","events_url":"https://api.github.com/users/azirbel/events{/privacy}","received_events_url":"https://api.github.com/users/azirbel/received_events","type":"User","site_admin":false},"body":"This upgrade allows easy installs into Ember CLI apps, and is also fully\r\nbackwards-compatible with globals-based Ember apps.\r\n\r\n* Convert from Coffeescript to JS\r\n* Restructure to use Ember CLI conventions\r\n* Blueprint to import Ember Table dependencies\r\n* New demo app\r\n    * Example code is auto-built from files backing the demo\r\n* Add globals build, with build code in the `packaging` folder\r\n* Fix/change to LazyContainerView involving `childViews`\r\n\r\nSee http://github.com/Addepar/ember-table-addon for more information.\r\n\r\nReviewers: @Addepar/ui2-developers especially @igillis @Dylnuge @cyril-sf \r\n\r\nThis commit replaces current `ember-table` code with the `ember-table-addon` code. I recommend that you not read the diff in this PR directly, but instead look at http://github.com/Addepar/ember-table-addon.","created_at":"2015-05-04T19:28:01Z","updated_at":"2015-05-05T15:19:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0194ced0d5d389203eb22a1977484df28db773a5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Addepar/ember-table/pulls/309/commits","review_comments_url":"https://api.github.com/repos/Addepar/ember-table/pulls/309/comments","review_comment_url":"https://api.github.com/repos/Addepar/ember-table/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Addepar/ember-table/issues/309/comments","statuses_url":"https://api.github.com/repos/Addepar/ember-table/statuses/b55a30aef41bea1b0c4e9ffa31e2c7b40039a581","head":{"label":"Addepar:azirbel/ember-cli","ref":"azirbel/ember-cli","sha":"b55a30aef41bea1b0c4e9ffa31e2c7b40039a581","user":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"repo":{"id":7193433,"name":"ember-table","full_name":"Addepar/ember-table","owner":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Addepar/ember-table","description":"","fork":false,"url":"https://api.github.com/repos/Addepar/ember-table","forks_url":"https://api.github.com/repos/Addepar/ember-table/forks","keys_url":"https://api.github.com/repos/Addepar/ember-table/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Addepar/ember-table/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Addepar/ember-table/teams","hooks_url":"https://api.github.com/repos/Addepar/ember-table/hooks","issue_events_url":"https://api.github.com/repos/Addepar/ember-table/issues/events{/number}","events_url":"https://api.github.com/repos/Addepar/ember-table/events","assignees_url":"https://api.github.com/repos/Addepar/ember-table/assignees{/user}","branches_url":"https://api.github.com/repos/Addepar/ember-table/branches{/branch}","tags_url":"https://api.github.com/repos/Addepar/ember-table/tags","blobs_url":"https://api.github.com/repos/Addepar/ember-table/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Addepar/ember-table/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Addepar/ember-table/git/refs{/sha}","trees_url":"https://api.github.com/repos/Addepar/ember-table/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Addepar/ember-table/statuses/{sha}","languages_url":"https://api.github.com/repos/Addepar/ember-table/languages","stargazers_url":"https://api.github.com/repos/Addepar/ember-table/stargazers","contributors_url":"https://api.github.com/repos/Addepar/ember-table/contributors","subscribers_url":"https://api.github.com/repos/Addepar/ember-table/subscribers","subscription_url":"https://api.github.com/repos/Addepar/ember-table/subscription","commits_url":"https://api.github.com/repos/Addepar/ember-table/commits{/sha}","git_commits_url":"https://api.github.com/repos/Addepar/ember-table/git/commits{/sha}","comments_url":"https://api.github.com/repos/Addepar/ember-table/comments{/number}","issue_comment_url":"https://api.github.com/repos/Addepar/ember-table/issues/comments{/number}","contents_url":"https://api.github.com/repos/Addepar/ember-table/contents/{+path}","compare_url":"https://api.github.com/repos/Addepar/ember-table/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Addepar/ember-table/merges","archive_url":"https://api.github.com/repos/Addepar/ember-table/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Addepar/ember-table/downloads","issues_url":"https://api.github.com/repos/Addepar/ember-table/issues{/number}","pulls_url":"https://api.github.com/repos/Addepar/ember-table/pulls{/number}","milestones_url":"https://api.github.com/repos/Addepar/ember-table/milestones{/number}","notifications_url":"https://api.github.com/repos/Addepar/ember-table/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Addepar/ember-table/labels{/name}","releases_url":"https://api.github.com/repos/Addepar/ember-table/releases{/id}","created_at":"2012-12-16T18:10:18Z","updated_at":"2015-05-05T00:19:34Z","pushed_at":"2015-05-04T20:28:38Z","git_url":"git://github.com/Addepar/ember-table.git","ssh_url":"git@github.com:Addepar/ember-table.git","clone_url":"https://github.com/Addepar/ember-table.git","svn_url":"https://github.com/Addepar/ember-table","homepage":"http://addepar.github.com/ember-table/","size":10298,"stargazers_count":1345,"watchers_count":1345,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":201,"mirror_url":null,"open_issues_count":69,"forks":201,"open_issues":69,"watchers":1345,"default_branch":"master"}},"base":{"label":"Addepar:master","ref":"master","sha":"8df61e6fcdbf2c585728a8aa60c5f7076beb83b7","user":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"repo":{"id":7193433,"name":"ember-table","full_name":"Addepar/ember-table","owner":{"login":"Addepar","id":847867,"avatar_url":"https://avatars.githubusercontent.com/u/847867?v=3","gravatar_id":"","url":"https://api.github.com/users/Addepar","html_url":"https://github.com/Addepar","followers_url":"https://api.github.com/users/Addepar/followers","following_url":"https://api.github.com/users/Addepar/following{/other_user}","gists_url":"https://api.github.com/users/Addepar/gists{/gist_id}","starred_url":"https://api.github.com/users/Addepar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Addepar/subscriptions","organizations_url":"https://api.github.com/users/Addepar/orgs","repos_url":"https://api.github.com/users/Addepar/repos","events_url":"https://api.github.com/users/Addepar/events{/privacy}","received_events_url":"https://api.github.com/users/Addepar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Addepar/ember-table","description":"","fork":false,"url":"https://api.github.com/repos/Addepar/ember-table","forks_url":"https://api.github.com/repos/Addepar/ember-table/forks","keys_url":"https://api.github.com/repos/Addepar/ember-table/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Addepar/ember-table/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Addepar/ember-table/teams","hooks_url":"https://api.github.com/repos/Addepar/ember-table/hooks","issue_events_url":"https://api.github.com/repos/Addepar/ember-table/issues/events{/number}","events_url":"https://api.github.com/repos/Addepar/ember-table/events","assignees_url":"https://api.github.com/repos/Addepar/ember-table/assignees{/user}","branches_url":"https://api.github.com/repos/Addepar/ember-table/branches{/branch}","tags_url":"https://api.github.com/repos/Addepar/ember-table/tags","blobs_url":"https://api.github.com/repos/Addepar/ember-table/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Addepar/ember-table/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Addepar/ember-table/git/refs{/sha}","trees_url":"https://api.github.com/repos/Addepar/ember-table/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Addepar/ember-table/statuses/{sha}","languages_url":"https://api.github.com/repos/Addepar/ember-table/languages","stargazers_url":"https://api.github.com/repos/Addepar/ember-table/stargazers","contributors_url":"https://api.github.com/repos/Addepar/ember-table/contributors","subscribers_url":"https://api.github.com/repos/Addepar/ember-table/subscribers","subscription_url":"https://api.github.com/repos/Addepar/ember-table/subscription","commits_url":"https://api.github.com/repos/Addepar/ember-table/commits{/sha}","git_commits_url":"https://api.github.com/repos/Addepar/ember-table/git/commits{/sha}","comments_url":"https://api.github.com/repos/Addepar/ember-table/comments{/number}","issue_comment_url":"https://api.github.com/repos/Addepar/ember-table/issues/comments{/number}","contents_url":"https://api.github.com/repos/Addepar/ember-table/contents/{+path}","compare_url":"https://api.github.com/repos/Addepar/ember-table/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Addepar/ember-table/merges","archive_url":"https://api.github.com/repos/Addepar/ember-table/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Addepar/ember-table/downloads","issues_url":"https://api.github.com/repos/Addepar/ember-table/issues{/number}","pulls_url":"https://api.github.com/repos/Addepar/ember-table/pulls{/number}","milestones_url":"https://api.github.com/repos/Addepar/ember-table/milestones{/number}","notifications_url":"https://api.github.com/repos/Addepar/ember-table/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Addepar/ember-table/labels{/name}","releases_url":"https://api.github.com/repos/Addepar/ember-table/releases{/id}","created_at":"2012-12-16T18:10:18Z","updated_at":"2015-05-05T00:19:34Z","pushed_at":"2015-05-04T20:28:38Z","git_url":"git://github.com/Addepar/ember-table.git","ssh_url":"git@github.com:Addepar/ember-table.git","clone_url":"https://github.com/Addepar/ember-table.git","svn_url":"https://github.com/Addepar/ember-table","homepage":"http://addepar.github.com/ember-table/","size":10298,"stargazers_count":1345,"watchers_count":1345,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":201,"mirror_url":null,"open_issues_count":69,"forks":201,"open_issues":69,"watchers":1345,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Addepar/ember-table/pulls/309"},"html":{"href":"https://github.com/Addepar/ember-table/pull/309"},"issue":{"href":"https://api.github.com/repos/Addepar/ember-table/issues/309"},"comments":{"href":"https://api.github.com/repos/Addepar/ember-table/issues/309/comments"},"review_comments":{"href":"https://api.github.com/repos/Addepar/ember-table/pulls/309/comments"},"review_comment":{"href":"https://api.github.com/repos/Addepar/ember-table/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Addepar/ember-table/pulls/309/commits"},"statuses":{"href":"https://api.github.com/repos/Addepar/ember-table/statuses/b55a30aef41bea1b0c4e9ffa31e2c7b40039a581"}}}}