From ce71f162e01c8d1024122d763c503532df909816 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 8 Sep 2022 19:20:06 +0300 Subject: [PATCH] Add title parameter to config --- apps/api/documents/api.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index c12dd3d17..1e2ce2ff4 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -974,25 +974,6 @@ return params; } - function getFrameTitle(config) { - var title = 'Powerful online editor for text documents, spreadsheets, and presentations'; - var appMap = { - 'text': 'text documents', - 'spreadsheet': 'spreadsheets', - 'presentation': 'presentations', - 'word': 'text documents', - 'cell': 'spreadsheets', - 'slide': 'presentations' - }; - - if (typeof config.documentType === 'string') { - var app = appMap[config.documentType.toLowerCase()]; - if (app) - title = 'Powerful online editor for ' + app; - } - return title; - } - function createIframe(config) { var iframe = document.createElement("iframe"); @@ -1002,7 +983,7 @@ iframe.align = "top"; iframe.frameBorder = 0; iframe.name = "frameEditor"; - iframe.title = getFrameTitle(config); + config.title && (typeof config.title === 'string') && (iframe.title = config.title); iframe.allowFullscreen = true; iframe.setAttribute("allowfullscreen",""); // for IE11 iframe.setAttribute("onmousewheel",""); // for Safari on Mac