diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c53c0782c..d59f63765 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -367,7 +367,7 @@ define([ this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onCanCopyCut', _.bind(this.onApiCanCopyCut, this)); - this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this)); + this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onApiMathTypes, this)); this.api.asc_registerCallback('asc_onColumnsProps', _.bind(this.onColumnsProps, this)); this.api.asc_registerCallback('asc_onSectionProps', _.bind(this.onSectionProps, this)); this.api.asc_registerCallback('asc_onContextMenu', _.bind(this.onContextMenu, this)); @@ -2414,6 +2414,16 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar, this.toolbar.btnInsertEquation); }, + onApiMathTypes: function(equation) { + this._equationTemp = equation; + var me = this; + var onShowBefore = function(menu) { + me.onMathTypes(me._equationTemp); + me.toolbar.btnInsertEquation.menu.off('show:before', onShowBefore); + }; + me.toolbar.btnInsertEquation.menu.on('show:before', onShowBefore); + }, + onMathTypes: function(equation) { var equationgrouparray = [], equationsStore = this.getCollection('EquationGroups');