From f5065e33b93ffd2b994bc68cc6ab63911760d407 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 29 Jul 2022 13:27:09 +0300 Subject: [PATCH] Refactoring --- apps/common/main/lib/controller/Plugins.js | 12 ++++++------ apps/common/main/lib/view/PluginDlg.js | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/common/main/lib/controller/Plugins.js b/apps/common/main/lib/controller/Plugins.js index af94c1831..b17280eab 100644 --- a/apps/common/main/lib/controller/Plugins.js +++ b/apps/common/main/lib/controller/Plugins.js @@ -162,8 +162,8 @@ define([ this.api.asc_registerCallback("asc_onPluginMouseMove", _.bind(this.onPluginMouseMove, this)); this.api.asc_registerCallback('asc_onPluginsReset', _.bind(this.resetPluginsList, this)); this.api.asc_registerCallback('asc_onPluginsInit', _.bind(this.onPluginsInit, this)); - this.api.asc_registerCallback('asc_onPluginShowButton', _.bind(this.onPluginsShowButton, this)); - this.api.asc_registerCallback('asc_onPluginHideButton', _.bind(this.onPluginsHideButton, this)); + this.api.asc_registerCallback('asc_onPluginShowButton', _.bind(this.onPluginShowButton, this)); + this.api.asc_registerCallback('asc_onPluginHideButton', _.bind(this.onPluginHideButton, this)); this.loadPlugins(); } @@ -464,12 +464,12 @@ define([ this.parsePlugins(pluginsdata) }, - onPluginsShowButton: function(type) { - this.pluginDlg && this.pluginDlg.showButton(type); + onPluginShowButton: function(id) { + this.pluginDlg && this.pluginDlg.showButton(id); }, - onPluginsHideButton: function(type) { - this.pluginDlg && this.pluginDlg.hideButton(type); + onPluginHideButton: function(id) { + this.pluginDlg && this.pluginDlg.hideButton(id); }, runAutoStartPlugins: function() { diff --git a/apps/common/main/lib/view/PluginDlg.js b/apps/common/main/lib/view/PluginDlg.js index 87ce5443d..3fc614de0 100644 --- a/apps/common/main/lib/view/PluginDlg.js +++ b/apps/common/main/lib/view/PluginDlg.js @@ -185,14 +185,14 @@ define([ } }, - showButton: function(type) { + showButton: function(id) { var header = this.$window.find('.header .tools.left'); - if (type=='back') { - var btn = header.find('#id-plugindlg-' + type); + if (id=='back') { + var btn = header.find('#id-plugindlg-' + id); if (btn.length<1) { - btn = $('
'); + btn = $('
'); btn.on('click', _.bind(function() { - this.fireEvent('header:click',type); + this.fireEvent('header:click',id); }, this)); header.prepend(btn); } @@ -201,10 +201,10 @@ define([ } }, - hideButton: function(type) { + hideButton: function(id) { var header = this.$window.find('.header .tools.left'); - if (type=='back') { - var btn = header.find('#id-plugindlg-' + type); + if (id=='back') { + var btn = header.find('#id-plugindlg-' + id); if (btn.length>0) { btn.hide(); }