From 800ef53817b48f5705c2042e9a37d5192a399a6d Mon Sep 17 00:00:00 2001 From: Alexey Koshelev Date: Fri, 6 Dec 2024 14:23:00 +0300 Subject: [PATCH] Macros: Add handler for run button --- apps/common/main/lib/view/MacrosDialog.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/view/MacrosDialog.js b/apps/common/main/lib/view/MacrosDialog.js index 2cd6d9b8e6..8a89dd9d6b 100644 --- a/apps/common/main/lib/view/MacrosDialog.js +++ b/apps/common/main/lib/view/MacrosDialog.js @@ -139,7 +139,8 @@ define([], function () { cls: 'btn-toolbar borders--small', iconCls: 'icon toolbar__icon btn-run', hint: this.tipMacrosRun - }); + }).on('click', _.bind(this.onRunMacros, this)); + this.btnMacrosAdd = new Common.UI.Button({ parentEl: $('#btn-macros-add'), cls: 'btn-toolbar borders--small', @@ -260,7 +261,10 @@ define([], function () { var selectedItem = me._state.currentElementMode === me.CurrentElementModeType.Macros ? me.listMacros.getSelectedRec() : me.listFunctions.getSelectedRec(); - selectedItem && selectedItem.set('value', value); + if(selectedItem) { + me._state.currentValue = value; + selectedItem.set('value', value); + } }); this.codeEditor.on('mouseup', function(x, y) { if (me.binding.dragStop) me.binding.dragStop();