{"action":"created","comment":{"url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/comments/29261700","id":29261700,"diff_hunk":"@@ -0,0 +1,190 @@\n+<!--\n+@license\n+Copyright (c) 2015 The Polymer Project Authors. All rights reserved.\n+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n+Code distributed by Google as part of the polymer project is also\n+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n+-->\n+\n+<link rel=\"import\" href=\"../polymer/polymer.html\">\n+\n+<!--\n+Fits an element in another element using `max-height` and `max-width`, and optionally centers it.\n+-->\n+<script>\n+\n+  Polymer.IronFitBehavior = {\n+\n+    properties: {\n+\n+      /**\n+       * The element that will receive a `max-height`/`width`. By default it is the same as `this`,\n+       * but it can be set to a child element. This is useful, for example, for implementing a\n+       * scrolling region inside the element.\n+       */\n+      sizingTarget: {\n+        type: Object,\n+        value: function() {\n+          return this;\n+        }\n+      },\n+\n+      /**\n+       * The element to fit `this` into.\n+       */\n+      fitInto: {\n+        type: Object,\n+        value: window\n+      },\n+\n+      /**\n+       * Set to true to auto-fit on attach.\n+       */\n+      autoFit: {\n+        type: Boolean,\n+        value: false\n+      },\n+\n+      _fitInfo: {\n+        type: Object\n+      }\n+\n+    },\n+\n+    get _sizingTarget() {\n+      return this.sizingTarget || this;\n+    },\n+\n+    get _fitWidth() {\n+      return this.fitInto === window ? this.fitInto.innerWidth : this.fitInto.getBoundingClientRect().width;\n+    },\n+\n+    get _fitHeight() {\n+      return this.fitInto === window ? this.fitInto.innerHeight : this.fitInto.getBoundingClientRect().height;\n+    },\n+\n+    attached: function() {\n+      if (this.autoFit) {\n+        if (getComputedStyle(this).display === 'none') {\n+          setTimeout(function() {","path":"iron-fit-behavior.html","position":71,"original_position":71,"commit_id":"a09530a6cde09d86e9c28814b62341b501d4398a","original_commit_id":"a09530a6cde09d86e9c28814b62341b501d4398a","user":{"login":"cdata","id":240083,"avatar_url":"https://avatars.githubusercontent.com/u/240083?v=3","gravatar_id":"","url":"https://api.github.com/users/cdata","html_url":"https://github.com/cdata","followers_url":"https://api.github.com/users/cdata/followers","following_url":"https://api.github.com/users/cdata/following{/other_user}","gists_url":"https://api.github.com/users/cdata/gists{/gist_id}","starred_url":"https://api.github.com/users/cdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdata/subscriptions","organizations_url":"https://api.github.com/users/cdata/orgs","repos_url":"https://api.github.com/users/cdata/repos","events_url":"https://api.github.com/users/cdata/events{/privacy}","received_events_url":"https://api.github.com/users/cdata/received_events","type":"User","site_admin":false},"body":"Ditto re: https://github.com/PolymerElements/iron-fit-behavior/pull/1/files#r29261678","created_at":"2015-04-28T16:38:42Z","updated_at":"2015-04-28T16:38:42Z","html_url":"https://github.com/PolymerElements/iron-fit-behavior/pull/1#discussion_r29261700","pull_request_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/comments/29261700"},"html":{"href":"https://github.com/PolymerElements/iron-fit-behavior/pull/1#discussion_r29261700"},"pull_request":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1","id":34114622,"html_url":"https://github.com/PolymerElements/iron-fit-behavior/pull/1","diff_url":"https://github.com/PolymerElements/iron-fit-behavior/pull/1.diff","patch_url":"https://github.com/PolymerElements/iron-fit-behavior/pull/1.patch","issue_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/1","number":1,"state":"open","locked":false,"title":"initial impl","user":{"login":"morethanreal","id":1202776,"avatar_url":"https://avatars.githubusercontent.com/u/1202776?v=3","gravatar_id":"","url":"https://api.github.com/users/morethanreal","html_url":"https://github.com/morethanreal","followers_url":"https://api.github.com/users/morethanreal/followers","following_url":"https://api.github.com/users/morethanreal/following{/other_user}","gists_url":"https://api.github.com/users/morethanreal/gists{/gist_id}","starred_url":"https://api.github.com/users/morethanreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morethanreal/subscriptions","organizations_url":"https://api.github.com/users/morethanreal/orgs","repos_url":"https://api.github.com/users/morethanreal/repos","events_url":"https://api.github.com/users/morethanreal/events{/privacy}","received_events_url":"https://api.github.com/users/morethanreal/received_events","type":"User","site_admin":false},"body":"@cdata @notwaldorf PTAL","created_at":"2015-04-25T22:58:54Z","updated_at":"2015-04-28T16:38:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fa79f610e8c8c177c989f0ef0112fe6499eaa00","assignee":{"login":"cdata","id":240083,"avatar_url":"https://avatars.githubusercontent.com/u/240083?v=3","gravatar_id":"","url":"https://api.github.com/users/cdata","html_url":"https://github.com/cdata","followers_url":"https://api.github.com/users/cdata/followers","following_url":"https://api.github.com/users/cdata/following{/other_user}","gists_url":"https://api.github.com/users/cdata/gists{/gist_id}","starred_url":"https://api.github.com/users/cdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdata/subscriptions","organizations_url":"https://api.github.com/users/cdata/orgs","repos_url":"https://api.github.com/users/cdata/repos","events_url":"https://api.github.com/users/cdata/events{/privacy}","received_events_url":"https://api.github.com/users/cdata/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1/commits","review_comments_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1/comments","review_comment_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/1/comments","statuses_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/statuses/a09530a6cde09d86e9c28814b62341b501d4398a","head":{"label":"PolymerElements:initial-impl","ref":"initial-impl","sha":"a09530a6cde09d86e9c28814b62341b501d4398a","user":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"repo":{"id":34589406,"name":"iron-fit-behavior","full_name":"PolymerElements/iron-fit-behavior","owner":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerElements/iron-fit-behavior","description":"Fits an element into another element","fork":false,"url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior","forks_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/forks","keys_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/teams","hooks_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/hooks","issue_events_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/events","assignees_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/tags","blobs_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/languages","stargazers_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/stargazers","contributors_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/contributors","subscribers_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/subscribers","subscription_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/subscription","commits_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/merges","archive_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/downloads","issues_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/labels{/name}","releases_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/releases{/id}","created_at":"2015-04-25T22:56:54Z","updated_at":"2015-04-25T22:56:54Z","pushed_at":"2015-04-25T22:58:55Z","git_url":"git://github.com/PolymerElements/iron-fit-behavior.git","ssh_url":"git@github.com:PolymerElements/iron-fit-behavior.git","clone_url":"https://github.com/PolymerElements/iron-fit-behavior.git","svn_url":"https://github.com/PolymerElements/iron-fit-behavior","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PolymerElements:master","ref":"master","sha":"b3abbcabe28e33f568cf24dc0b3fccd50952788a","user":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"repo":{"id":34589406,"name":"iron-fit-behavior","full_name":"PolymerElements/iron-fit-behavior","owner":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerElements/iron-fit-behavior","description":"Fits an element into another element","fork":false,"url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior","forks_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/forks","keys_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/teams","hooks_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/hooks","issue_events_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/events","assignees_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/tags","blobs_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/languages","stargazers_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/stargazers","contributors_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/contributors","subscribers_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/subscribers","subscription_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/subscription","commits_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/merges","archive_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/downloads","issues_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/labels{/name}","releases_url":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/releases{/id}","created_at":"2015-04-25T22:56:54Z","updated_at":"2015-04-25T22:56:54Z","pushed_at":"2015-04-25T22:58:55Z","git_url":"git://github.com/PolymerElements/iron-fit-behavior.git","ssh_url":"git@github.com:PolymerElements/iron-fit-behavior.git","clone_url":"https://github.com/PolymerElements/iron-fit-behavior.git","svn_url":"https://github.com/PolymerElements/iron-fit-behavior","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1"},"html":{"href":"https://github.com/PolymerElements/iron-fit-behavior/pull/1"},"issue":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/1"},"comments":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/PolymerElements/iron-fit-behavior/statuses/a09530a6cde09d86e9c28814b62341b501d4398a"}}}}