aboutsummaryrefslogtreecommitdiffstats
path: root/src/VideoList.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-05-12 05:53:12 +0300
committerRblSb <msrblsb@gmail.com>2020-05-12 05:53:12 +0300
commit2f4005083452d61ddaf7542b195927b1d0d6227f (patch)
tree42378b7d97e132971072c576329e8605f512b04d /src/VideoList.hx
parent9b960a699739c17179cdb1d5c9c9cb3efa912ebe (diff)
Fix setNext item button
Diffstat (limited to 'src/VideoList.hx')
-rw-r--r--src/VideoList.hx4
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 {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage