Имам този код, който активира jquery draggable във файлове на система за управление, когато пусна файл на друг, изскача диалогов прозорец за потвърждение, когато щракна върху отмяна, draggable трябва автоматично да се върне, може ли някой да ми помогне?
$(function() {
$('.files-icons li').live('mouseenter',function() {
var $this = $(this);
if(!$this.is(':data(draggable)')) {
$this.draggable({
revert: 'invalid',
helper: "original",
opacity: 0.35,
snapMode: 'inner',
snap:true,
snapTolerance: 35,
distance: 8,
revertDuration: 200,
start: function(){
}
});
}
});
$('.ic').live('mouseenter',function() {
var $this = $(this);
if(!$this.is(':data(droppable)')) {
$this.droppable({
tolerance: 'intersect',
over: function() {
},
out: function() {
},
drop: function(event, ui) {
dest = $(this).attr('rel');
$.modal.confirm('Are u sure?', function()
{
$.ajax({
url:'<?= $this->request->webroot; ?>files/move/source:' + ui.helper.attr('rel') + '/dest:' + dest ,
}).done(function(data) {
$(ui.draggable).remove();
});
}, function() {
return false;
});
}
});
}
});
});