fall back to default title if one is not suggested

pull/1/head
ansuz 8 years ago
parent e77ad4e909
commit d009b7400c

@ -321,9 +321,9 @@ define([
})) { return text; } })) { return text; }
}; };
var suggestName = function () { var suggestName = function (fallback) {
if (document.title === defaultName) { if (document.title === defaultName) {
return getHeadingText() || ""; return getHeadingText() || fallback || "";
} else { } else {
return document.title || getHeadingText() || defaultName; return document.title || getHeadingText() || defaultName;
} }
@ -510,7 +510,7 @@ define([
var exportFile = function () { var exportFile = function () {
var html = getHTML(); var html = getHTML();
var suggestion = suggestName(); var suggestion = suggestName('cryptpad-document');
Cryptpad.prompt(Messages.exportPrompt, Cryptpad.prompt(Messages.exportPrompt,
Cryptpad.fixFileName(suggestion) + '.html', function (filename) { Cryptpad.fixFileName(suggestion) + '.html', function (filename) {
if (!(typeof(filename) === 'string' && filename)) { return; } if (!(typeof(filename) === 'string' && filename)) { return; }

Loading…
Cancel
Save