OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS |
9 --> | 9 --> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 function getFirstItemFromList(list) { | 66 function getFirstItemFromList(list) { |
67 var listRect = list.getBoundingClientRect(); | 67 var listRect = list.getBoundingClientRect(); |
68 return document.elementFromPoint(listRect.left + 1, listRect.top + 1); | 68 return document.elementFromPoint(listRect.left + 1, listRect.top + 1); |
69 } | 69 } |
70 | 70 |
71 function getLastItemFromList(list) { | 71 function getLastItemFromList(list) { |
72 var listRect = list.getBoundingClientRect(); | 72 var listRect = list.getBoundingClientRect(); |
73 return document.elementFromPoint(listRect.left + 1, listRect.top + listRect.
height - 1); | 73 return document.elementFromPoint(listRect.left + 1, listRect.top + listRect.
height - 1); |
74 } | 74 } |
| 75 |
| 76 function isFullOfItems(list) { |
| 77 var listRect = list.getBoundingClientRect(); |
| 78 var listHeight = listRect.height - 1; |
| 79 var item, y = listRect.top + 1; |
| 80 // IE 10 & 11 doesn't render propertly :( |
| 81 var badPixels = 0; |
| 82 while (y < listHeight) { |
| 83 item = document.elementFromPoint(listRect.left + 1, y); |
| 84 if (item.parentNode && !item.parentNode._templateInstance) { |
| 85 badPixels++; |
| 86 } |
| 87 if (badPixels > 3) { |
| 88 return false; |
| 89 } |
| 90 y += 2; |
| 91 } |
| 92 return true; |
| 93 } |
75 </script> | 94 </script> |
OLD | NEW |