diff --git a/www/common/metadata-manager.js b/www/common/metadata-manager.js index fed4183d3..1426bc7cf 100644 --- a/www/common/metadata-manager.js +++ b/www/common/metadata-manager.js @@ -64,7 +64,9 @@ define(['json.sortify'], function (Sortify) { if (metadataObj.title !== rememberedTitle) { rememberedTitle = metadataObj.title; - titleChangeHandlers.forEach(function (f) { f(metadataObj.title); }); + titleChangeHandlers.forEach(function (f) { + f(metadataObj.title, metadataObj.defaultTitle); + }); } changeHandlers.forEach(function (f) { f(); }); diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 60bc142a8..39ce6af3e 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -312,7 +312,8 @@ define([ var title = currentTabTitle.replace(/\{title\}/g, currentTitle || 'CryptPad'); document.title = title; }; - sframeChan.on('Q_SET_PAD_TITLE_IN_DRIVE', function (newTitle, cb) { + sframeChan.on('Q_SET_PAD_TITLE_IN_DRIVE', function (newData, cb) { + var newTitle = newData.title || newData.defaultTitle; currentTitle = newTitle; setDocumentTitle(); var data = { diff --git a/www/common/sframe-common-title.js b/www/common/sframe-common-title.js index 0a838ef34..dcbf6288a 100644 --- a/www/common/sframe-common-title.js +++ b/www/common/sframe-common-title.js @@ -59,8 +59,11 @@ define([ exp.defaultTitle = md.defaultTitle; exp.title = md.title; }); - metadataMgr.onTitleChange(function (title) { - sframeChan.query('Q_SET_PAD_TITLE_IN_DRIVE', title, function (err) { + metadataMgr.onTitleChange(function (title, defaultTitle) { + sframeChan.query('Q_SET_PAD_TITLE_IN_DRIVE', { + title: title, + defaultTitle: defaultTitle + }, function (err) { if (err === 'E_OVER_LIMIT') { return void UI.alert(Messages.pinLimitNotPinned, null, true); } else if (err) { return; }