From ceb67537ac6f0256f7bc4c300491752f7288b814 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 20 Sep 2017 15:41:26 +0300 Subject: [PATCH] Fix Bug 35851. --- apps/documenteditor/main/app/controller/Main.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 82a3ccc7e..076484751 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -196,7 +196,7 @@ define([ $(document.body).on('blur', 'input, textarea', function(e) { if (!me.isModalShowed) { if (!e.relatedTarget || - !/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */ + !/area_id/.test(e.target.id) && (e.relatedTarget.localName != 'input' || $(e.target).parent().find(e.relatedTarget).length<1) /* Check if focus in combobox goes from input to it's menu button or menu items */ && (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */ && (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ { me.api.asc_enableKeyEvents(true); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 208cf51e2..3ef344dd3 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -192,7 +192,7 @@ define([ $(document.body).on('blur', 'input, textarea', function(e) { if (!me.isModalShowed) { if (!e.relatedTarget || - !/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */ + !/area_id/.test(e.target.id) && (e.relatedTarget.localName != 'input' || $(e.target).parent().find(e.relatedTarget).length<1) /* Check if focus in combobox goes from input to it's menu button or menu items */ && (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */ && (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ { me.api.asc_enableKeyEvents(true); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index ddc0808f8..8aef78da9 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -201,7 +201,7 @@ define([ if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible())) { if (!e.relatedTarget || - !/area_id/.test(e.target.id) && $(e.target).parent().find(e.relatedTarget).length<1 /* Check if focus in combobox goes from input to it's menu button or menu items */ + !/area_id/.test(e.target.id) && (e.relatedTarget.localName != 'input' || $(e.target).parent().find(e.relatedTarget).length<1) /* Check if focus in combobox goes from input to it's menu button or menu items */ && (e.relatedTarget.localName != 'input' || !/form-control/.test(e.relatedTarget.className)) /* Check if focus goes to text input with class "form-control" */ && (e.relatedTarget.localName != 'textarea' || /area_id/.test(e.relatedTarget.id))) /* Check if focus goes to textarea, but not to "area_id" */ { me.api.asc_enableKeyEvents(true);