Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve drag and drop experience #425

Merged
merged 1 commit into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions css/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,6 @@
background-color: rgba( $color-primary, .3 );
}

&.dragover > div.subtasks-container > ol {
min-height: 37px;
}

.subtasks-container {
margin-left: 35px;

Expand Down
23 changes: 1 addition & 22 deletions src/components/TaskDragContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
:move="onMove"
@end="onEnd"
>
<slot :move="onMove" />
<slot />
</draggable>
</template>

Expand All @@ -53,16 +53,6 @@ export default {
'setStart',
]),

/**
* Called when a task is dragged.
*
* @param {Object} $event The event which caused the move
*/
onMove: function($event) {
this.cleanUpDragging()
$event.related.classList.add('dragover')
},

/**
* Called when a task is dropped.
*
Expand All @@ -78,20 +68,9 @@ export default {
// Move the task to a new calendar or parent.
this.prepareMoving(task, $event)
this.prepareCollecting(task, $event)
this.cleanUpDragging()
$event.stopPropagation()
},

/**
* Called when we stopped dragging. Cleans up temporarily added classes.
*/
cleanUpDragging: function() {
var items = document.getElementsByClassName('task-item')
for (let i = 0; i < items.length; i++) {
items[i].classList.remove('dragover')
}
},

/**
* Function to move a task to a new calendar or parent
*
Expand Down