From 2232518c646b968f80917295b2ccfb993865004b Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 4 May 2017 12:01:37 +0200 Subject: [PATCH] set title after uploading --- www/file/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/file/main.js b/www/file/main.js index 004a665e0..c0970c24f 100644 --- a/www/file/main.js +++ b/www/file/main.js @@ -92,6 +92,9 @@ define([ var title = document.title = res.metadata.filename; myFile = res.content; myDataType = res.metadata.type; + + var defaultName = Cryptpad.getDefaultName(Cryptpad.parsePadUrl(window.location.href)); + APP.updateTitle(title || defaultName); }); }); }); @@ -147,7 +150,7 @@ define([ return data ? data.title : undefined; }; - var updateTitle = function (newTitle) { + var updateTitle = APP.updateTitle = function (newTitle) { Cryptpad.renamePad(newTitle, function (err, data) { if (err) { console.log("Couldn't set pad title");