From ccac16c69c39897c3637894a50cbbbd2ec482f48 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 25 Sep 2020 18:17:54 +0300 Subject: [PATCH] [DE] Refactoring keydown in cross-reference dialog --- apps/documenteditor/main/app/view/CrossReferenceDialog.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/CrossReferenceDialog.js b/apps/documenteditor/main/app/view/CrossReferenceDialog.js index ba689ea6ad..094a906e34 100644 --- a/apps/documenteditor/main/app/view/CrossReferenceDialog.js +++ b/apps/documenteditor/main/app/view/CrossReferenceDialog.js @@ -185,6 +185,7 @@ define([ store: new Common.UI.DataViewStore(), itemTemplate: _.template('
<%= value %>
') }); + this.refList.on('entervalue', _.bind(this.onPrimary, this)); this.lblWhich = $window.find('#id-dlg-cross-which'); @@ -205,7 +206,10 @@ define([ this.options.handler.call(this, state); } if (state=='ok') { - this.insertReference(); + if(document.activeElement && document.activeElement.localName == 'textarea' && /area_id/.test(document.activeElement.id)){ + return; + } + !this.btnInsert.isDisabled() && this.insertReference(); return; } this.close();