Skip to content

Commit

Permalink
Feature/store (#2907)
Browse files Browse the repository at this point in the history
* Added parametr in plugins for disable interface loader.

* Added plugin method for show/hide buttons in plugin's header.
And changed event "asc_pluginButtonClick". Now it can return string| number. (string - for header's button, number - for footer's button and close button).

* Fixed problem with NaN detekting.
  • Loading branch information
AlexeyMatveev686 authored Jul 29, 2022
1 parent 9d171a9 commit 301eebd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
17 changes: 17 additions & 0 deletions common/apiBase_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1351,4 +1351,21 @@
{
return installPlugin(config, "Updated");
};

/**
* Show or hide buttons in header.
* @memberof Api
* @typeofeditors ["CDE", "CSE", "CPE"]
* @param {string} [id] - The id of the button.
* @param {boolean} [bShow] - The flag show or hide the button.
* @alias ShowButton
*/
Api.prototype["pluginMethod_ShowButton"] = function(id, bShow)
{
if (bShow) {
this.sendEvent("asc_onPluginShowButton", id);
} else {
this.sendEvent("asc_onPluginHideButton", id);
}
};
})(window);
12 changes: 12 additions & 0 deletions common/apiCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -5639,6 +5639,7 @@
this.minVersion = "";
this.version = "";
this.isConnector = false;
this.loader;

this.variations = [];
}
Expand Down Expand Up @@ -5721,6 +5722,15 @@
this.variations = value;
};

CPlugin.prototype["get_Loader"] = function()
{
return this.loader;
};
CPlugin.prototype["set_Loader"] = function(value)
{
this.loader = value;
};

CPlugin.prototype["serialize"] = function()
{
var _object = {};
Expand All @@ -5731,6 +5741,7 @@
_object["baseUrl"] = this.baseUrl;
_object["minVersion"] = this.minVersion;
_object["isConnector"] = this.isConnector;
_object["loader"] = this.loader;

if (this.group)
{
Expand All @@ -5755,6 +5766,7 @@
this.baseUrl = (_object["baseUrl"] != null) ? _object["baseUrl"] : this.baseUrl;
this.minVersion = (_object["minVersion"] != null) ? _object["minVersion"] : this.minVersion;
this.isConnector = (_object["isConnector"] != null) ? _object["isConnector"] : this.isConnector;
this.loader = (_object["loader"] != null) ? _object["loader"] : this.loader;

if (true)
{
Expand Down
3 changes: 2 additions & 1 deletion common/plugins.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions common/plugins/plugin_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,9 @@
case "button":
{
var _buttonId = parseInt(pluginData.button);
if (isNaN(_buttonId))
_buttonId =pluginData.button;

if (!window.Asc.plugin.button && -1 == _buttonId)
window.Asc.plugin.executeCommand("close", "");
else
Expand Down

0 comments on commit 301eebd

Please sign in to comment.