[DE] Fix opening symbol table dialog

This commit is contained in:
Julia Radzhabova 2019-11-15 14:42:07 +03:00
parent f2d2ef5fc3
commit 5aed3e8b51

View file

@ -2475,23 +2475,25 @@ define([
}, },
onInsertSymbolClick: function() { onInsertSymbolClick: function() {
if (this.dlgSymbolTable && this.dlgSymbolTable.isVisible()) return;
if (this.api) { if (this.api) {
var me = this, var me = this;
win = new Common.Views.SymbolTableDialog({ me.dlgSymbolTable = new Common.Views.SymbolTableDialog({
api: me.api, api: me.api,
lang: me.mode.lang, lang: me.mode.lang,
modal: false, modal: false,
type: 1, type: 1,
buttons: [{value: 'ok', caption: this.textInsert}, 'close'], buttons: [{value: 'ok', caption: this.textInsert}, 'close'],
handler: function(dlg, result, settings) { handler: function(dlg, result, settings) {
if (result == 'ok') { if (result == 'ok') {
me.api.pluginMethod_PasteHtml("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>"); me.api.pluginMethod_PasteHtml("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>");
} else } else
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
} }
}); });
win.show(); me.dlgSymbolTable.show();
win.on('symbol:dblclick', function(cmp, settings) { me.dlgSymbolTable.on('symbol:dblclick', function(cmp, settings) {
me.api.pluginMethod_PasteHtml("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>"); me.api.pluginMethod_PasteHtml("<span style=\"font-family:'" + settings.font + "'\">" + settings.symbol + "</span>");
}); });
} }