Commit 70ab3428 authored by Alexey Golubev's avatar Alexey Golubev Committed by GitHub

Merge pull request #186 from ONLYOFFICE/feature/v5.0.3.3

Feature/v5.0.3.3
parents 1dc6944b 746622ad
...@@ -1568,7 +1568,7 @@ ...@@ -1568,7 +1568,7 @@
return 0; return 0;
// если плагин работает - то и мы тоже // если плагин работает - то и мы тоже
if (this.pluginsManager && this.pluginsManager.current != null) if (this.pluginsManager && this.pluginsManager.isWorked())
return 0; return 0;
if (this.isEmbedVersion) if (this.isEmbedVersion)
......
...@@ -201,6 +201,17 @@ ...@@ -201,6 +201,17 @@
} }
return null; return null;
}, },
isWorked : function()
{
for (var i in this.runnedPluginsMap)
{
if (this.pluginsMap[i] && !this.pluginsMap[i].isSystem)
{
return true;
}
}
return false;
},
run : function(guid, variation, data, isNoUse_isNoSystemPluginsOnlyOne) run : function(guid, variation, data, isNoUse_isNoSystemPluginsOnlyOne)
{ {
if (this.runAndCloseData) // run only on close!!! if (this.runAndCloseData) // run only on close!!!
...@@ -216,7 +227,7 @@ ...@@ -216,7 +227,7 @@
var isSystem = this.pluginsMap[guid].isSystem; var isSystem = this.pluginsMap[guid].isSystem;
var isRunned = (this.runnedPluginsMap[guid] !== undefined) ? true : false; var isRunned = (this.runnedPluginsMap[guid] !== undefined) ? true : false;
if (isRunned) if (isRunned && ((variation == null) || variation == this.runnedPluginsMap[guid].currentVariation))
{ {
// запуск запущенного => закрытие // запуск запущенного => закрытие
this.close(guid); this.close(guid);
...@@ -715,8 +726,7 @@ ...@@ -715,8 +726,7 @@
pluginData.setAttribute("guid", guid); pluginData.setAttribute("guid", guid);
pluginData.setAttribute("type", "onCommandCallback"); pluginData.setAttribute("type", "onCommandCallback");
var runObj = window.g_asc_plugins.runnedPluginsMap[guid]; var _iframe = document.getElementById(runObject.frameId);
var _iframe = document.getElementById(runObj.frameId);
if (_iframe) if (_iframe)
_iframe.contentWindow.postMessage(pluginData.serialize(), "*"); _iframe.contentWindow.postMessage(pluginData.serialize(), "*");
}); });
...@@ -742,8 +752,7 @@ ...@@ -742,8 +752,7 @@
pluginData.setAttribute("guid", guid); pluginData.setAttribute("guid", guid);
pluginData.setAttribute("type", "onCommandCallback"); pluginData.setAttribute("type", "onCommandCallback");
var runObj = window.g_asc_plugins.runnedPluginsMap[guid]; var _iframe = document.getElementById(runObject.frameId);
var _iframe = document.getElementById(runObj.frameId);
if (_iframe) if (_iframe)
_iframe.contentWindow.postMessage(pluginData.serialize(), "*"); _iframe.contentWindow.postMessage(pluginData.serialize(), "*");
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment