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' } }; } 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); }); }