From a8d610a6db06739e7713444d37947f061c130646 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 25 Jun 2019 16:13:50 +0300 Subject: [PATCH 1/2] Fix order for spellcheck variants (Issue #224) (#196) --- apps/common/main/lib/component/Menu.js | 2 +- apps/documenteditor/main/app/view/DocumentHolder.js | 12 ++++++------ .../main/app/view/DocumentHolder.js | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 42fafc2e6..67decc1ae 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -304,7 +304,7 @@ define([ } else if (index === 0) { menuRoot.prepend(item.render().el); } else { - $('li:nth-child(' + (index+1) + ')', menuRoot).before(item.render().el); + menuRoot.children('li:nth-child(' + (index+1) + ')').before(item.render().el); } item.on('click', _.bind(me.onItemClick, me)); diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index c8d8a85c3..b2dc03600 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -815,19 +815,19 @@ define([ if (arr.length > 0) { if (isParagraph) { - _.each(arr, function(variant){ - me.textMenu.insertItem(0, variant); + _.each(arr, function(variant, index){ + me.textMenu.insertItem(index, variant); }) } else { - _.each(arr, function(variant){ - me.menuSpellCheckTable.menu.insertItem(0, variant); + _.each(arr, function(variant, index){ + me.menuSpellCheckTable.menu.insertItem(index, variant); }) } } if (arrMore.length > 0) { - _.each(arrMore, function(variant){ - moreMenu.menu.insertItem(0, variant); + _.each(arrMore, function(variant, index){ + moreMenu.menu.addItem(variant); }); } diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 5cba80fb6..cea0af992 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -766,19 +766,19 @@ define([ if (arr.length > 0) { if (isParagraph) { - _.each(arr, function(variant){ - me.textMenu.insertItem(0, variant); + _.each(arr, function(variant, index){ + me.textMenu.insertItem(index, variant); }) } else { - _.each(arr, function(variant){ - me.menuSpellCheckTable.menu.insertItem(0, variant); + _.each(arr, function(variant, index){ + me.menuSpellCheckTable.menu.insertItem(index, variant); }) } } if (arrMore.length > 0) { - _.each(arrMore, function(variant){ - moreMenu.menu.insertItem(0, variant); + _.each(arrMore, function(variant, index){ + moreMenu.menu.addItem(variant); }); } From 2d7711e3404095b3862d94671120626bdc8069fb Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Fri, 28 Jun 2019 15:08:15 +0300 Subject: [PATCH 2/2] Update index.html.desktop (#201) --- apps/api/documents/index.html.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/documents/index.html.desktop b/apps/api/documents/index.html.desktop index d95b31995..8f6aea8a6 100644 --- a/apps/api/documents/index.html.desktop +++ b/apps/api/documents/index.html.desktop @@ -101,7 +101,7 @@ mode : urlParams["mode"] || 'edit', lang : urlParams["lang"] || 'en', user: { - id: urlParams["userid"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek' + id: urlParams["userid"] || urlParams["username"] || 'uid-901', name: urlParams["username"] || 'Chuk.Gek' } }; }