Implementing the draggable directive