mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-02-10 18:05:06 +08:00
Add new events scheme
This commit is contained in:
@ -164,6 +164,27 @@
|
||||
pluginObj.contextMenuEvents[id]();
|
||||
};
|
||||
|
||||
window.Asc.plugin.attachEvent = function(id, action)
|
||||
{
|
||||
var pluginObj = window.Asc.plugin;
|
||||
if (!pluginObj._events)
|
||||
pluginObj._events = {};
|
||||
|
||||
pluginObj._events[id] = action;
|
||||
};
|
||||
window.Asc.plugin.detachEvent = function(id)
|
||||
{
|
||||
var pluginObj = window.Asc.plugin;
|
||||
if (pluginObj._events && pluginObj._events[id])
|
||||
delete pluginObj._events[id];
|
||||
};
|
||||
window.Asc.plugin.onEvent = function(id, data)
|
||||
{
|
||||
var pluginObj = window.Asc.plugin;
|
||||
if (pluginObj._events && pluginObj._events[id])
|
||||
pluginObj._events[id](data);
|
||||
};
|
||||
|
||||
window.onunload = function() {
|
||||
if (window.addEventListener)
|
||||
window.removeEventListener("message", onMessage, false);
|
||||
|
||||
Reference in New Issue
Block a user