From 781950c412ea4943dae6b9ac1b1cc9569bf8b501 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 15 Aug 2019 16:51:48 +0300 Subject: [PATCH] [DE] Fill equations on menu opening --- apps/documenteditor/main/app/controller/Toolbar.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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');