我有这段代码,当我在另一个文件上释放文件时,激活管理系统文件中的 jquery 可拖动当我单击取消时弹出一个确认对话框,可拖动应该自动恢复,有人可以帮我吗?
$(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;
});
}
});
}
});
});