Drag from recent pads

pull/1/head
yflory 5 years ago
parent c3d6b72763
commit aef0f29c2f

@ -1207,9 +1207,6 @@ define([
if ($element.is('.cp-app-drive-element-notrash')) { if ($element.is('.cp-app-drive-element-notrash')) {
// We can't delete elements in virtual categories // We can't delete elements in virtual categories
hide.push('delete'); hide.push('delete');
} else {
// We can only open parent in virtual categories
hide.push('openparent');
} }
if (!$element.is('.cp-border-color-file')) { if (!$element.is('.cp-border-color-file')) {
//hide.push('download'); //hide.push('download');
@ -1310,6 +1307,10 @@ define([
hide.push('open'); hide.push('open');
} }
if (!APP.loggedIn) {
hide.push('openparent');
}
filter = function ($el, className) { filter = function ($el, className) {
if (hide.indexOf(className) !== -1) { return true; } if (hide.indexOf(className) !== -1) { return true; }
}; };
@ -1325,7 +1326,7 @@ define([
'deleteowned', 'removesf', 'access', 'properties', 'hashtag']; 'deleteowned', 'removesf', 'access', 'properties', 'hashtag'];
break; break;
case 'default': case 'default':
show = ['open', 'openro', 'preview', 'share', 'openparent', 'delete', 'deleteowned', 'properties', 'access', 'hashtag', 'makeacopy']; show = ['open', 'openro', 'preview', 'openincode', 'share', 'download', 'openparent', 'delete', 'deleteowned', 'properties', 'access', 'hashtag', 'makeacopy', 'savelocal', 'rename'];
break; break;
case 'trashtree': { case 'trashtree': {
show = ['empty']; show = ['empty'];
@ -2117,7 +2118,7 @@ define([
onElementClick(e, $element); onElementClick(e, $element);
}); });
if (!isTrash) { if (!isTrash) {
$element.contextmenu(openContextMenu('tree')); $element.on('contextmenu', openContextMenu('tree'));
$element.data('context', 'tree'); $element.data('context', 'tree');
} else { } else {
$element.contextmenu(openContextMenu('trash')); $element.contextmenu(openContextMenu('trash'));
@ -3316,25 +3317,17 @@ define([
var $icon = getFileIcon(id); var $icon = getFileIcon(id);
var ro = manager.isReadOnlyFile(id); var ro = manager.isReadOnlyFile(id);
// ro undefined means it's an old hash which doesn't support read-only // ro undefined means it's an old hash which doesn't support read-only
var roClass = typeof(ro) === 'undefined' ? ' cp-app-drive-element-noreadonly' : /*var roClass = typeof(ro) === 'undefined' ? ' cp-app-drive-element-noreadonly' :
ro ? ' cp-app-drive-element-readonly' : ''; ro ? ' cp-app-drive-element-readonly' : '';
var $element = $('<li>', { var $element = $('<li>', {
'class': 'cp-app-drive-element cp-app-drive-element-notrash cp-app-drive-element-file cp-app-drive-element-row' + roClass, 'class': 'cp-app-drive-element cp-app-drive-element-notrash cp-app-drive-element-file cp-app-drive-element-row' + roClass,
}); });*/
$element.prepend($icon).dblclick(function () { var parentPath = path.slice();
openFile(id); var key = parentPath.pop();
}); var root = manager.find(parentPath);
addFileData(id, $element); var $element = createElement(parentPath, key, root);
$element.data('path', path); $element.off('contextmenu').contextmenu(openContextMenu('default'));
$element.click(function(e) {
e.stopPropagation();
onElementClick(e, $element);
});
$element.contextmenu(openContextMenu('default'));
$element.data('context', 'default'); $element.data('context', 'default');
/*if (draggable) {
addDragAndDropHandlers($element, path, false, false);
}*/
$list.append($element); $list.append($element);
i++; i++;
}); });

Loading…
Cancel
Save