(index)
| 1208 | this.cycle(); |
| 1209 | } |
| 1210 | to(index) { |
| 1211 | const items = this._getItems(); |
| 1212 | if (index > items.length - 1 || index < 0) { |
| 1213 | return; |
| 1214 | } |
| 1215 | if (this._isSliding) { |
| 1216 | EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); |
| 1217 | return; |
| 1218 | } |
| 1219 | const activeIndex = this._getItemIndex(this._getActive()); |
| 1220 | if (activeIndex === index) { |
| 1221 | return; |
| 1222 | } |
| 1223 | const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; |
| 1224 | this._slide(order, items[index]); |
| 1225 | } |
| 1226 | dispose() { |
| 1227 | if (this._swipeHelper) { |
| 1228 | this._swipeHelper.dispose(); |
no test coverage detected