(index)
| 1231 | this.cycle(); |
| 1232 | } |
| 1233 | to(index) { |
| 1234 | const items = this._getItems(); |
| 1235 | if (index > items.length - 1 || index < 0) { |
| 1236 | return; |
| 1237 | } |
| 1238 | if (this._isSliding) { |
| 1239 | EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); |
| 1240 | return; |
| 1241 | } |
| 1242 | const activeIndex = this._getItemIndex(this._getActive()); |
| 1243 | if (activeIndex === index) { |
| 1244 | return; |
| 1245 | } |
| 1246 | const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; |
| 1247 | this._slide(order, items[index]); |
| 1248 | } |
| 1249 | dispose() { |
| 1250 | if (this._swipeHelper) { |
| 1251 | this._swipeHelper.dispose(); |
no test coverage detected