| 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} | |
| 234 */ | 233 */ |
| 235 _discoverInfo: function() { | 234 _discoverInfo: function() { |
| 236 if (this._fitInfo) { | 235 if (this._fitInfo) { |
| 237 return; | 236 return; |
| 238 } | 237 } |
| 239 var target = window.getComputedStyle(this); | 238 var target = window.getComputedStyle(this); |
| 240 var sizer = window.getComputedStyle(this.sizingTarget); | 239 var sizer = window.getComputedStyle(this.sizingTarget); |
| 241 | 240 |
| 242 this._fitInfo = { | 241 this._fitInfo = { |
| 243 inlineStyle: { | 242 inlineStyle: { |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 // ones overlapping vertically. | 570 // ones overlapping vertically. |
| 572 if (position.croppedArea === 0 && alignOk) { | 571 if (position.croppedArea === 0 && alignOk) { |
| 573 break; | 572 break; |
| 574 } | 573 } |
| 575 } | 574 } |
| 576 | 575 |
| 577 return position; | 576 return position; |
| 578 } | 577 } |
| 579 | 578 |
| 580 }; | 579 }; |
| OLD | NEW |