Simplify playlist drop callback

Use value passed to the callback instead of target property
This commit is contained in:
Rafostar
2021-01-19 21:07:24 +01:00
committed by Rafał Dzięgiel
parent 994491d687
commit d36a972864

View File

@@ -188,7 +188,7 @@ class ClapperPlaylistItem extends Gtk.ListBoxRow
_onDrop(target, value, x, y)
{
const destIndex = this.get_index();
const targetIndex = target.value.get_index();
const targetIndex = value.get_index();
if(destIndex === targetIndex)
return true;
@@ -196,8 +196,8 @@ class ClapperPlaylistItem extends Gtk.ListBoxRow
const listBox = this.get_ancestor(Gtk.ListBox);
if(listBox && destIndex >= 0) {
listBox.remove(target.value);
listBox.insert(target.value, destIndex);
listBox.remove(value);
listBox.insert(value, destIndex);
return true;
}