From 5aed3e8b516e58aeea32146c9834d52a128a1b29 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 15 Nov 2019 14:42:07 +0300 Subject: [PATCH] [DE] Fix opening symbol table dialog --- .../main/app/controller/Toolbar.js | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 7f5f5bdd7..d4ceada56 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2475,23 +2475,25 @@ define([ }, onInsertSymbolClick: function() { + if (this.dlgSymbolTable && this.dlgSymbolTable.isVisible()) return; + if (this.api) { - var me = this, - win = new Common.Views.SymbolTableDialog({ - api: me.api, - lang: me.mode.lang, - modal: false, - type: 1, - buttons: [{value: 'ok', caption: this.textInsert}, 'close'], - handler: function(dlg, result, settings) { - if (result == 'ok') { - me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); - } else - Common.NotificationCenter.trigger('edit:complete', me.toolbar); - } - }); - win.show(); - win.on('symbol:dblclick', function(cmp, settings) { + var me = this; + me.dlgSymbolTable = new Common.Views.SymbolTableDialog({ + api: me.api, + lang: me.mode.lang, + modal: false, + type: 1, + buttons: [{value: 'ok', caption: this.textInsert}, 'close'], + handler: function(dlg, result, settings) { + if (result == 'ok') { + me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); + } else + Common.NotificationCenter.trigger('edit:complete', me.toolbar); + } + }); + me.dlgSymbolTable.show(); + me.dlgSymbolTable.on('symbol:dblclick', function(cmp, settings) { me.api.pluginMethod_PasteHtml("" + settings.symbol + ""); }); }