Fix the 'File' entry in the drive 'New' menu

pull/1/head
yflory 8 years ago
parent f1271bfd03
commit 811d031ffd

@ -1415,6 +1415,12 @@ define([
}); });
$block.find('a.newdoc').click(function () { $block.find('a.newdoc').click(function () {
var type = $(this).attr('data-type') || 'pad'; var type = $(this).attr('data-type') || 'pad';
// We can't create a hash for files before uploading the file
if (type === 'file') { // TODO: remove when filename are gone?
sessionStorage[Cryptpad.newPadPathKey] = filesOp.isPathIn(currentPath, [TRASH]) ? '' : currentPath;
window.open('/' + type + '/');
return;
}
var name = Cryptpad.getDefaultName({type: type}); var name = Cryptpad.getDefaultName({type: type});
filesOp.addFile(currentPath, name, type, onCreated); filesOp.addFile(currentPath, name, type, onCreated);
}); });

Loading…
Cancel
Save