Merge pull request #758 from ONLYOFFICE/fix/bugfix

[Mobile] Fix plugins loading
This commit is contained in:
Julia Radzhabova 2021-03-27 23:48:06 +03:00 committed by GitHub
commit c0efac841b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ define([
this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.showPluginModal, this)); this.api.asc_registerCallback("asc_onPluginShow", _.bind(this.showPluginModal, this));
this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.pluginClose, this)); this.api.asc_registerCallback("asc_onPluginClose", _.bind(this.pluginClose, this));
this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.pluginResize, this)); this.api.asc_registerCallback("asc_onPluginResize", _.bind(this.pluginResize, this));
this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.registerPlugins, this)); this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this));
}, },
onLaunch: function () { onLaunch: function () {
@ -225,6 +225,11 @@ define([
} }
}, },
onPluginsInit: function(pluginsdata) {
!(pluginsdata instanceof Array) && (pluginsdata = pluginsdata["pluginsData"]);
this.registerPlugins(pluginsdata)
},
registerPlugins: function(plugins) { registerPlugins: function(plugins) {
var me = this; var me = this;
var arr = []; var arr = [];