mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-23 18:54:54 +08:00
[apijs] extend app path to optimize editor loading
This commit is contained in:
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user