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

pull/1/head
yflory 2017-06-06 12:09:55 +02:00
parent f1271bfd03
commit 811d031ffd
1 changed files with 6 additions and 0 deletions

View File

@ -1415,6 +1415,12 @@ define([
});
$block.find('a.newdoc').click(function () {
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});
filesOp.addFile(currentPath, name, type, onCreated);
});