Add title parameter to config

This commit is contained in:
Julia Radzhabova 2022-09-08 19:20:06 +03:00 committed by catbasilio
parent 189bca3111
commit 0c56678ce1

View file

@ -974,25 +974,6 @@
return params; 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) { function createIframe(config) {
var iframe = document.createElement("iframe"); var iframe = document.createElement("iframe");
@ -1002,7 +983,7 @@
iframe.align = "top"; iframe.align = "top";
iframe.frameBorder = 0; iframe.frameBorder = 0;
iframe.name = "frameEditor"; iframe.name = "frameEditor";
iframe.title = getFrameTitle(config); config.title && (typeof config.title === 'string') && (iframe.title = config.title);
iframe.allowFullscreen = true; iframe.allowFullscreen = true;
iframe.setAttribute("allowfullscreen",""); // for IE11 iframe.setAttribute("allowfullscreen",""); // for IE11
iframe.setAttribute("onmousewheel",""); // for Safari on Mac iframe.setAttribute("onmousewheel",""); // for Safari on Mac