From a3e36a3d3c838898f90c7bd456af86dd1e641e83 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 17:27:32 +0300 Subject: [PATCH] Don't close plugin dialog when ESC is pressed. Fix Bug 32983. --- apps/common/main/lib/component/Window.js | 5 +++-- apps/common/main/lib/view/Plugins.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 4459ec1bd..2025d3f26 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -154,7 +154,8 @@ define([ maxwidth: undefined, maxheight: undefined, minwidth: 0, - minheight: 0 + minheight: 0, + enableKeyEvents: true }; var template = '
<%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' + @@ -182,7 +183,7 @@ define([ } function _keydown(event) { - if (!this.isLocked() && this.isVisible()) { + if (!this.isLocked() && this.isVisible() && this.initConfig.enableKeyEvents) { switch (event.keyCode) { case Common.UI.Keys.ESC: if ( $('.asc-loadmask').length<1 ) { diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index 3289dbba2..9a360a09c 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -198,7 +198,8 @@ define([ var _options = {}; _.extend(_options, { cls: 'advanced-settings-dlg', - header: true + header: true, + enableKeyEvents: false }, options); var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34;