diff options
Diffstat (limited to 'src/VideoList.hx')
| -rw-r--r-- | src/VideoList.hx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/VideoList.hx b/src/VideoList.hx index e2d88d5..0799cfa 100644 --- a/src/VideoList.hx +++ b/src/VideoList.hx @@ -39,10 +39,12 @@ abstract VideoList(Array<VideoItem>) from Array<VideoItem> to Array<VideoItem> { else this.insert(itemPos + 1, item); } - public function setNextItem(pos:Int, itemPos:Int):Void { + public function setNextItem(pos:Int, itemPos:Int):Int { final next = this[pos]; this.remove(next); + if (pos < itemPos) itemPos--; this.insert(itemPos + 1, next); + return itemPos; } public function toggleItemType(pos:Int):Void { |
