From 811d031ffd407df64425d75488dc01e8ffa2a329 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 6 Jun 2017 12:09:55 +0200 Subject: [PATCH] Fix the 'File' entry in the drive 'New' menu --- www/drive/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/www/drive/main.js b/www/drive/main.js index 10d98e400..b6cdfd2c9 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -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); });