mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
Fixes for background ole plugins
This commit is contained in:
@ -872,20 +872,44 @@
|
|||||||
|
|
||||||
let isSystem = this.pluginsMap[guid].isSystem();
|
let isSystem = this.pluginsMap[guid].isSystem();
|
||||||
let isBackground = this.pluginsMap[guid].isBackground();
|
let isBackground = this.pluginsMap[guid].isBackground();
|
||||||
let isRunned = (this.runnedPluginsMap[guid] !== undefined) ? true : false;
|
let runObject = this.runnedPluginsMap[guid];
|
||||||
|
let isRunned = runObject ? true : false;
|
||||||
|
|
||||||
if (isRunned)
|
if (isRunned)
|
||||||
{
|
{
|
||||||
// запуск запущенного => закрытие (только для видимых, так как в интерфейсе "отжим" кнопки плагина - приходит run)
|
// запуск запущенного => закрытие (только для видимых, так как в интерфейсе "отжим" кнопки плагина - приходит run)
|
||||||
if (isSystem || isBackground)
|
if (isSystem || isBackground)
|
||||||
|
{
|
||||||
|
if ((plugin.variations[runObject.currentVariation].initDataType === Asc.EPluginDataType.ole) &&
|
||||||
|
data && data.getAttribute && data.getAttribute("objectId"))
|
||||||
|
{
|
||||||
|
let sendedData = (data == null || data === "") ? new CPluginData() : data;
|
||||||
|
this.correctData(sendedData);
|
||||||
|
let frame = document.getElementById(runObject.frameId);
|
||||||
|
if (frame)
|
||||||
|
{
|
||||||
|
sendedData.setAttribute("type", "init");
|
||||||
|
sendedData.setAttribute("options", this.getPluginOptions(guid));
|
||||||
|
frame.contentWindow.postMessage(sendedData.serialize(), "*");
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
this.close(guid);
|
this.close(guid);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isBackground)
|
if (isBackground)
|
||||||
|
{
|
||||||
|
if ((plugin.variations[0].initDataType === Asc.EPluginDataType.ole) &&
|
||||||
|
data && data.getAttribute && data.getAttribute("objectId"))
|
||||||
|
{
|
||||||
|
// не запускаем сервис, если он отключен.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this.addUsedBackgroundPlugins(guid);
|
this.addUsedBackgroundPlugins(guid);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isSystem && !this.isSupportManyPlugins && !isOnlyResize)
|
if (!isSystem && !this.isSupportManyPlugins && !isOnlyResize)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user