mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Simplify playlist drop callback
Use value passed to the callback instead of target property
This commit is contained in:
@@ -188,7 +188,7 @@ class ClapperPlaylistItem extends Gtk.ListBoxRow
|
|||||||
_onDrop(target, value, x, y)
|
_onDrop(target, value, x, y)
|
||||||
{
|
{
|
||||||
const destIndex = this.get_index();
|
const destIndex = this.get_index();
|
||||||
const targetIndex = target.value.get_index();
|
const targetIndex = value.get_index();
|
||||||
|
|
||||||
if(destIndex === targetIndex)
|
if(destIndex === targetIndex)
|
||||||
return true;
|
return true;
|
||||||
@@ -196,8 +196,8 @@ class ClapperPlaylistItem extends Gtk.ListBoxRow
|
|||||||
const listBox = this.get_ancestor(Gtk.ListBox);
|
const listBox = this.get_ancestor(Gtk.ListBox);
|
||||||
|
|
||||||
if(listBox && destIndex >= 0) {
|
if(listBox && destIndex >= 0) {
|
||||||
listBox.remove(target.value);
|
listBox.remove(value);
|
||||||
listBox.insert(target.value, destIndex);
|
listBox.insert(value, destIndex);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user