mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Fix rendering of successors, drag and drop
This commit is contained in:
parent
34aeb83891
commit
d0a5f6b731
7 changed files with 24 additions and 20 deletions
|
|
@ -203,6 +203,23 @@ function enable_rich_interaction(){
|
|||
$('input[name=tag_list]').live('keypress', function(){
|
||||
$(this).attr('edited', 'true');
|
||||
});
|
||||
|
||||
/* Drag & Drop for successor/predecessor */
|
||||
function drop_todo(evt, ui) {
|
||||
dragged_todo = ui.draggable[0].id.split('_')[2];
|
||||
dropped_todo = this.id.split('_')[2];
|
||||
ui.draggable.hide();
|
||||
$(this).block({message: null});
|
||||
$.post('/todos/add_predecessor',
|
||||
{successor: dragged_todo, predecessor: dropped_todo},
|
||||
null, 'script');
|
||||
}
|
||||
|
||||
$('.item-show').draggable({handle: '.grip', revert: 'invalid'});
|
||||
$('.item-show').droppable({
|
||||
drop: drop_todo,
|
||||
hoverClass: 'hover'
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue