(itemsDomRefs: Array<TabInStrip | TabSeparatorInStrip>, containerWidth: number, selectedItemWidth: number, startIndex?: number)
| 1242 | } |
| 1243 | |
| 1244 | _findFirstVisibleItem(itemsDomRefs: Array<TabInStrip | TabSeparatorInStrip>, containerWidth: number, selectedItemWidth: number, startIndex?: number) { |
| 1245 | if (startIndex === undefined) { |
| 1246 | startIndex = itemsDomRefs.length - 1; |
| 1247 | } |
| 1248 | |
| 1249 | let lastVisible = startIndex + 1; |
| 1250 | |
| 1251 | for (let index = startIndex; index >= 0; index--) { |
| 1252 | const itemWidth = this._getItemWidth(itemsDomRefs[index]); |
| 1253 | |
| 1254 | if (containerWidth < selectedItemWidth + itemWidth) { |
| 1255 | break; |
| 1256 | } |
| 1257 | |
| 1258 | selectedItemWidth += itemWidth; |
| 1259 | lastVisible = index; |
| 1260 | } |
| 1261 | |
| 1262 | return lastVisible; |
| 1263 | } |
| 1264 | |
| 1265 | _findLastVisibleItem(itemsDomRefs: Array<TabInStrip | TabSeparatorInStrip>, containerWidth: number, selectedItemWidth: number, startIndex = 0) { |
| 1266 | let lastVisibleIndex = startIndex - 1; |
no test coverage detected