Refactoring
This commit is contained in:
parent
00b63283bd
commit
f5065e33b9
|
@ -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() {
|
||||
|
|
|
@ -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 = $('<div id="id-plugindlg-' + type + '" class="tool help" style="font-size:20px;">←</div>');
|
||||
btn = $('<div id="id-plugindlg-' + id + '" class="tool help" style="font-size:20px;">←</div>');
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue