From bfe97358ad0ebb55076a0ae9bf2ae56a67353792 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 28 Mar 2017 11:06:56 +0300 Subject: [PATCH] Lost focus from chat window when getting changes from other users. --- apps/documenteditor/main/app/controller/Main.js | 6 +++++- apps/presentationeditor/main/app/controller/Main.js | 6 +++++- apps/spreadsheeteditor/main/app/controller/Main.js | 8 ++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index b18104942..bbf0a49d0 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -169,6 +169,8 @@ define([ if (!/area_id/.test(e.target.id)) { if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = true; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = true; } }); @@ -181,6 +183,8 @@ define([ me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = false; } } }).on('dragover', function(e) { @@ -592,7 +596,7 @@ define([ if ( type == Asc.c_oAscAsyncActionType.BlockInteraction && (!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) && - !( id == Asc.c_oAscAsyncAction['ApplyChanges'] && this.dontCloseDummyComment ) ) { + !( id == Asc.c_oAscAsyncAction['ApplyChanges'] && (this.dontCloseDummyComment || this.dontCloseChat)) ) { // this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод this.api.asc_enableKeyEvents(true); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index d1853e910..85b8c3b0c 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -159,6 +159,8 @@ define([ if (!/area_id/.test(e.target.id)) { if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = true; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = true; } }); @@ -171,6 +173,8 @@ define([ me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = false; } } }).on('dragover', function(e) { @@ -404,7 +408,7 @@ define([ if ((id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2)) this.synchronizeChanges(); - if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && this.dontCloseDummyComment )) { + if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.dontCloseChat))) { this.onEditComplete(this.loadMask); this.api.asc_enableKeyEvents(true); } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 6fcaea23a..2cc505e57 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -167,6 +167,8 @@ define([ if (e && e.target && !/area_id/.test(e.target.id)) { if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = true; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = true; } }); @@ -181,6 +183,8 @@ define([ me.api.asc_enableKeyEvents(true); if (/msg-reply/.test(e.target.className)) me.dontCloseDummyComment = false; + else if (/chat-msg-text/.test(e.target.id)) + me.dontCloseChat = false; } } }).on('dragover', function(e) { @@ -426,12 +430,12 @@ define([ this.setLongActionView(action); } else { if (this.loadMask) { - if (this.loadMask.isVisible() && !this.dontCloseDummyComment) + if (this.loadMask.isVisible() && !this.dontCloseDummyComment && !this.dontCloseChat) this.api.asc_enableKeyEvents(true); this.loadMask.hide(); } - if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !( (id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && this.dontCloseDummyComment )) + if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !( (id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.dontCloseChat) )) this.onEditComplete(this.loadMask, {restorefocus:true}); } },