| OLD | NEW |
| 1 /** | 1 /** |
| 2 `Polymer.IronFitBehavior` fits an element in another element using `max-height`
and `max-width`, and | 2 `Polymer.IronFitBehavior` fits an element in another element using `max-height`
and `max-width`, and |
| 3 optionally centers it in the window or another element. | 3 optionally centers it in the window or another element. |
| 4 | 4 |
| 5 The element will only be sized and/or positioned if it has not already been size
d and/or positioned | 5 The element will only be sized and/or positioned if it has not already been size
d and/or positioned |
| 6 by CSS. | 6 by CSS. |
| 7 | 7 |
| 8 CSS properties | Action | 8 CSS properties | Action |
| 9 -----------------------------|------------------------------------------- | 9 -----------------------------|------------------------------------------- |
| 10 `position` set | Element is not centered horizontally or verticall
y | 10 `position` set | Element is not centered horizontally or verticall
y |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 */ | 223 */ |
| 224 fit: function() { | 224 fit: function() { |
| 225 this._discoverInfo(); | 225 this._discoverInfo(); |
| 226 this.position(); | 226 this.position(); |
| 227 this.constrain(); | 227 this.constrain(); |
| 228 this.center(); | 228 this.center(); |
| 229 }, | 229 }, |
| 230 | 230 |
| 231 /** | 231 /** |
| 232 * Memoize information needed to position and size the target element. | 232 * Memoize information needed to position and size the target element. |
| 233 * @suppress {deprecated} |
| 233 */ | 234 */ |
| 234 _discoverInfo: function() { | 235 _discoverInfo: function() { |
| 235 if (this._fitInfo) { | 236 if (this._fitInfo) { |
| 236 return; | 237 return; |
| 237 } | 238 } |
| 238 var target = window.getComputedStyle(this); | 239 var target = window.getComputedStyle(this); |
| 239 var sizer = window.getComputedStyle(this.sizingTarget); | 240 var sizer = window.getComputedStyle(this.sizingTarget); |
| 240 | 241 |
| 241 this._fitInfo = { | 242 this._fitInfo = { |
| 242 inlineStyle: { | 243 inlineStyle: { |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // ones overlapping vertically. | 571 // ones overlapping vertically. |
| 571 if (position.croppedArea === 0 && alignOk) { | 572 if (position.croppedArea === 0 && alignOk) { |
| 572 break; | 573 break; |
| 573 } | 574 } |
| 574 } | 575 } |
| 575 | 576 |
| 576 return position; | 577 return position; |
| 577 } | 578 } |
| 578 | 579 |
| 579 }; | 580 }; |
| OLD | NEW |