Commit ef3a3a47 authored by techird's avatar techird

拖拽移动体验优化

parent a68e07dd
......@@ -141,7 +141,7 @@ KityMinder.LANG['zh-cn'] = {
'move_file_confirm': '确定把 "{0}" 移动到 "{1}" 吗?',
'rename': '重命名',
'rename_success': '<b>{0}</b> 重命名成功',
'move_success': '<b>{0}</b> 移动成功',
'move_success': '<b>{0}</b> 移动成功到 <b>{1}</b>',
'command': {
'appendsiblingnode': '插入同级主题',
......
......@@ -164,7 +164,7 @@
display: inline-block;
width: 20px;
height: 20px;
margin-left: 15px;
margin-left: 10px;
vertical-align: middle;
border-radius: 2px;
box-sizing: border-box;
......
......@@ -254,20 +254,26 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
}
function dragOver(e) {
e.preventDefault();
if ($(e.target).hasClass('filename')) e.preventDefault();
}
function dirDragEnter(e) {
if (!$(e.target).hasClass('dir')) return;
$(e.target).addClass('drag-enter');
var $target = $(e.target).closest('.dir');
$target.addClass('drag-enter');
if (e.target != $target[0]) $target.addClass('enter-child');
}
function dirDragLeave(e) {
$(e.target).removeClass('drag-enter');
if ($(e.target).hasClass('dir')) {
if ($(e.target).hasClass('enter-child')) {
return $(e.target).removeClass('enter-child');
}
$(e.target).removeClass('drag-enter');
}
}
function dirDrop(e) {
var $target = $(e.target).removeClass('drag-enter');
var $target = $(e.target).closest('.dir').removeClass('drag-enter');
if (!$target.hasClass('dir')) return;
......@@ -290,7 +296,7 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
mv(sourcePath, destinationPath).then(function() {
$dragging.remove();
Finder.fire('mv', sourcePath, destinationPath, SIGNATURE);
notice.info(minder.getLang('ui.move_success', destination.filename));
notice.info(minder.getLang('ui.move_success', source.filename, destination.filename));
})['catch'](function(e) {
notice.error('err_move_file', e);
}).then(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment