diff --git a/apps/common/main/lib/controller/Comments.js b/apps/common/main/lib/controller/Comments.js index 660d60bba..559792187 100644 --- a/apps/common/main/lib/controller/Comments.js +++ b/apps/common/main/lib/controller/Comments.js @@ -291,7 +291,7 @@ define([ return false; }, - onShowComment: function (id, selected) { + onShowComment: function (id, selected, fromLeftPanelSelection) { var comment = this.findComment(id); if (comment) { if (null !== comment.get('quote')) { @@ -319,9 +319,11 @@ define([ this.isSelectedComment = selected; } - this.api.asc_selectComment(id); - this._dontScrollToComment = true; - this.api.asc_showComment(id,false); + if (!fromLeftPanelSelection || !((0 === _.difference(this.uids, [id]).length) && (0 === _.difference([id], this.uids).length))) { + this.api.asc_selectComment(id); + this._dontScrollToComment = true; + this.api.asc_showComment(id,false); + } } } else { diff --git a/apps/common/main/lib/view/Comments.js b/apps/common/main/lib/view/Comments.js index 4c77e66bd..bc5bc47f1 100644 --- a/apps/common/main/lib/view/Comments.js +++ b/apps/common/main/lib/view/Comments.js @@ -283,7 +283,16 @@ define([ } else if (!btn.hasClass('msg-reply') && !btn.hasClass('btn-resolve-check') && !btn.hasClass('btn-resolve')) { - me.fireEvent('comment:show', [commentId, false]); + var isTextSelected = false; + if (btn.hasClass('user-message')) { + if (window.getSelection) { + var selection = window.getSelection(); + isTextSelected = (selection.toString()!=='') + } else if (document.selection) { + isTextSelected = document.selection; + } + } + me.fireEvent('comment:show', [commentId, false, isTextSelected]); } } }, diff --git a/apps/documenteditor/mobile/app/controller/add/AddTable.js b/apps/documenteditor/mobile/app/controller/add/AddTable.js index d22a4f96c..fef864537 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddTable.js +++ b/apps/documenteditor/mobile/app/controller/add/AddTable.js @@ -123,12 +123,7 @@ define([ var size = picker.value; if (me.api) { - me.api.put_Table(parseInt(size[0]), parseInt(size[1])); - - var properties = new Asc.CTableProp(); - properties.put_TableStyle(type); - - me.api.tblApply(properties); + me.api.put_Table(parseInt(size[0]), parseInt(size[1]), type.toString()); } } } diff --git a/apps/documenteditor/mobile/app/controller/edit/EditTable.js b/apps/documenteditor/mobile/app/controller/edit/EditTable.js index c94e62bbf..c94825acb 100644 --- a/apps/documenteditor/mobile/app/controller/edit/EditTable.js +++ b/apps/documenteditor/mobile/app/controller/edit/EditTable.js @@ -598,7 +598,7 @@ define([ $('#edit-table-styles .table-styles div').removeClass('active'); $target.addClass('active'); - properties.put_TableStyle(type); + properties.put_TableStyle(type.toString()); me.api.tblApply(properties); }, diff --git a/apps/presentationeditor/mobile/app/controller/add/AddTable.js b/apps/presentationeditor/mobile/app/controller/add/AddTable.js index 5f4e3d8ae..193e9ea59 100644 --- a/apps/presentationeditor/mobile/app/controller/add/AddTable.js +++ b/apps/presentationeditor/mobile/app/controller/add/AddTable.js @@ -104,12 +104,7 @@ define([ var size = picker.value; if (me.api) { - me.api.put_Table(parseInt(size[0]), parseInt(size[1])); - - var properties = new Asc.CTableProp(); - properties.put_TableStyle(type); - - me.api.tblApply(properties); + me.api.put_Table(parseInt(size[0]), parseInt(size[1]), undefined, type.toString()); } } } diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditTable.js b/apps/presentationeditor/mobile/app/controller/edit/EditTable.js index 91d13c7c6..280165d27 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditTable.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditTable.js @@ -442,7 +442,7 @@ define([ $('#edit-table-styles .table-styles div').removeClass('active'); $target.addClass('active'); - properties.put_TableStyle(type); + properties.put_TableStyle(type.toString()); me.api.tblApply(properties); },