[apijs] extend app path to optimize editor loading

This commit is contained in:
maxkadushkin
2024-08-27 19:42:24 +03:00
parent 06a0cad461
commit c7549b6868

View File

@ -1039,6 +1039,7 @@
if (type && typeof type[4] === 'string') appType = 'slide';
}
}
path = extendAppPath(config, path);
path += appMap[appType];
const path_type = config.type === "mobile" ? "mobile" :
@ -1191,5 +1192,15 @@
return dest;
}
function extendAppPath(config, path) {
if ( !config.isLocalFile ) {
const ver = '/{{PRODUCT_VERSION}}-{{SERVER_POSTFIX}}';
const pos = path.indexOf('/web-apps/app');
if ( pos > 0 && ver.lastIndexOf('{{') < 0 )
return [path.slice(0, pos), ver, path.slice(pos)].join('');
}
return path;
}
})(window.DocsAPI = window.DocsAPI || {}, window, document);