From ff3143e9556662c5f5d7a2cb6b29fdbfb07b7672 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 23 Jun 2016 10:50:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8=20=D1=81?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=D0=BC=D0=B8=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=B4=D0=BA=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0=20=D0=B8=D0=B5=D1=80=D0=BE=D0=B3=D0=BB=D0=B8=D1=84?= =?UTF-8?q?=D0=BE=D0=B2.=20fixed=20Bug=2032701,=20fixed=20Bug=2032696.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/main/lib/component/ComboBox.js | 2 ++ apps/common/main/lib/component/Menu.js | 3 +++ apps/documenteditor/main/app/controller/Main.js | 12 +++++++++++- apps/presentationeditor/main/app/controller/Main.js | 12 +++++++++++- apps/spreadsheeteditor/main/app/controller/Main.js | 12 +++++++++++- 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index e451e0d7c..490c83490 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -232,6 +232,7 @@ define([ }, onBeforeShowMenu: function(e) { + Common.NotificationCenter.trigger('menu:show'); this.trigger('show:before', this, e); if (this.options.hint) { var tip = this.cmpEl.data('bs.tooltip'); @@ -273,6 +274,7 @@ define([ onAfterHideMenu: function(e) { this.cmpEl.find('.dropdown-toggle').blur(); this.trigger('hide:after', this, e); + Common.NotificationCenter.trigger('menu:hide'); }, onAfterKeydownMenu: function(e) { diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index a68db2469..5cac51db6 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -410,6 +410,8 @@ define([ }, onBeforeShowMenu: function(e) { + Common.NotificationCenter.trigger('menu:show'); + if (this.mustLayout) { delete this.mustLayout; this.doLayout.call(this); @@ -439,6 +441,7 @@ define([ onAfterHideMenu: function(e) { this.trigger('hide:after', this, e); + Common.NotificationCenter.trigger('menu:hide'); }, onAfterKeydownMenu: function(e) { diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index a8c1e8e24..cc1fe52b8 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -172,7 +172,8 @@ define([ /* * TODO: Workaround bug #25004. Clipboard feature processing in sdk. */ - if (!(Common.Utils.isSafari && Common.Utils.isMac) && !/area_id/.test(e.target.id)) { + if (!(Common.Utils.isSafari && Common.Utils.isMac) && !/area_id/.test(e.target.id) && + $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */) { me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; @@ -214,6 +215,15 @@ define([ me.onEditComplete(); } }, + 'menu:show': function(e){ + me.api.asc_enableKeyEvents(false); + }, + 'menu:hide': function(e){ + if (!me.isModalShowed) { + me.api.asc_enableKeyEvents(true); + me.onEditComplete(); + } + }, 'edit:complete': _.bind(me.onEditComplete, me) }); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index f7a799eeb..cf5ddf146 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -154,7 +154,8 @@ define([ /* * TODO: Workaround bug #25004. Clipboard feature processing in sdk. */ - if (!(Common.Utils.isSafari && Common.Utils.isMac) && !/area_id/.test(e.target.id)) { + if (!(Common.Utils.isSafari && Common.Utils.isMac) && !/area_id/.test(e.target.id) && + $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */) { me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; @@ -196,6 +197,15 @@ define([ me.onEditComplete(); } }, + 'menu:show': function(e){ + me.api.asc_enableKeyEvents(false); + }, + 'menu:hide': function(e){ + if (!me.isModalShowed) { + me.api.asc_enableKeyEvents(true); + me.onEditComplete(); + } + }, 'edit:complete': _.bind(me.onEditComplete, me) }); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index ab8840d6a..25545b4ab 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -172,7 +172,8 @@ define([ $(document.body).on('blur', 'input, textarea', function(e) { if (this.isAppDisabled === true) return; - if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible()) && !/area_id/.test(e.target.id)) { + if (!me.isModalShowed && !(me.loadMask && me.loadMask.isVisible()) && !/area_id/.test(e.target.id) && + $(e.target).parent().find(e.relatedTarget).length<1 /* When focus in combobox goes from input to it's menu button or menu items */) { me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; @@ -212,6 +213,15 @@ define([ me.onEditComplete(); } }, + 'menu:show': function(e){ + me.api.asc_enableKeyEvents(false); + }, + 'menu:hide': function(e){ + if (!me.isModalShowed) { + me.api.asc_enableKeyEvents(true); + me.onEditComplete(); + } + }, 'edit:complete': _.bind(this.onEditComplete, this), 'settings:unitschanged':_.bind(this.unitsChanged, this) });