Commit f2d95710 authored by Oleg Korshul's avatar Oleg Korshul

re-init plugins

parent 6c7d90d2
...@@ -1531,6 +1531,7 @@ ...@@ -1531,6 +1531,7 @@
this.buttons = [{"text" : "Ok", "primary" : true}, {"text" : "Cancel", "primary" : false}]; this.buttons = [{"text" : "Ok", "primary" : true}, {"text" : "Cancel", "primary" : false}];
this.size = undefined; this.size = undefined;
this.initOnSelectionChanged = undefined;
} }
CPluginVariation.prototype["get_Description"] = function() CPluginVariation.prototype["get_Description"] = function()
...@@ -1643,6 +1644,14 @@ ...@@ -1643,6 +1644,14 @@
{ {
this.size = value; this.size = value;
}; };
CPluginVariation.prototype["get_InitOnSelectionChanged"] = function()
{
return this.initOnSelectionChanged;
};
CPluginVariation.prototype["set_InitOnSelectionChanged"] = function(value)
{
this.initOnSelectionChanged = value;
};
CPluginVariation.prototype["serialize"] = function() CPluginVariation.prototype["serialize"] = function()
{ {
...@@ -1667,6 +1676,7 @@ ...@@ -1667,6 +1676,7 @@
_object["buttons"] = this.buttons; _object["buttons"] = this.buttons;
_object["size"] = this.size; _object["size"] = this.size;
_object["initOnSelectionChanged"] = this.initOnSelectionChanged;
return _object; return _object;
}; };
...@@ -1692,6 +1702,7 @@ ...@@ -1692,6 +1702,7 @@
this.buttons = (_object["buttons"] != null) ? _object["buttons"] : this.buttons; this.buttons = (_object["buttons"] != null) ? _object["buttons"] : this.buttons;
this.size = (_object["size"] != null) ? _object["size"] : this.size; this.size = (_object["size"] != null) ? _object["size"] : this.size;
this.initOnSelectionChanged = (_object["initOnSelectionChanged"] != null) ? _object["initOnSelectionChanged"] : this.initOnSelectionChanged;
}; };
function CPlugin() function CPlugin()
......
...@@ -196,7 +196,8 @@ ...@@ -196,7 +196,8 @@
ifr.style.zIndex = -1000; ifr.style.zIndex = -1000;
document.body.appendChild(ifr); document.body.appendChild(ifr);
this.api.sendEvent("asc_onPluginShow", this.current, this.currentVariation); if (this.startData.getAttribute("resize") !== true)
this.api.sendEvent("asc_onPluginShow", this.current, this.currentVariation);
} }
}, },
...@@ -337,6 +338,15 @@ ...@@ -337,6 +338,15 @@
pluginData.setAttribute("guid", this.current.guid); pluginData.setAttribute("guid", this.current.guid);
_iframe.contentWindow.postMessage(pluginData.serialize(), "*"); _iframe.contentWindow.postMessage(pluginData.serialize(), "*");
} }
},
onChangedSelectionData : function()
{
if (this.current && this.current.variations[this.currentVariation].initOnSelectionChanged === true)
{
// re-init
this.init();
}
} }
}; };
...@@ -474,6 +484,10 @@ ...@@ -474,6 +484,10 @@
window.g_asc_plugins.api = api; window.g_asc_plugins.api = api;
window.g_asc_plugins["api"] = window.g_asc_plugins.api; window.g_asc_plugins["api"] = window.g_asc_plugins.api;
api.asc_registerCallback('asc_onSelectionEnd', function(){
window.g_asc_plugins.onChangedSelectionData();
});
window.g_asc_plugins.api.asc_registerCallback('asc_onDocumentContentReady', function() window.g_asc_plugins.api.asc_registerCallback('asc_onDocumentContentReady', function()
{ {
......
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