Currently there doesn't seem to be a way to delegate the longpress, so it doesn't work when binding future elements.
As a temporary workaround I have added a selector variable to the function. So my event handlers are as follow:
$this.on('mousedown', selector, mousedown_callback);
$this.on('mouseup', selector, mouseup_callback);
$this.on('mousemove', selector, move_callback);
Where $this refers to a parent object or document and selector to the pressable element itself. This works, but I don't know if this would be the best approach.
PS. Thank you for the mousemove fix!
Currently there doesn't seem to be a way to delegate the longpress, so it doesn't work when binding future elements.
As a temporary workaround I have added a selector variable to the function. So my event handlers are as follow:
Where
$thisrefers to a parent object or document andselectorto the pressable element itself. This works, but I don't know if this would be the best approach.PS. Thank you for the mousemove fix!