Fix moving task to another row and avoid using $element.parent()