diff --git a/odex25_base/quick_language_selection/static/src/js/custom_js.js b/odex25_base/quick_language_selection/static/src/js/custom_js.js index d284febf5..02bc088cd 100644 --- a/odex25_base/quick_language_selection/static/src/js/custom_js.js +++ b/odex25_base/quick_language_selection/static/src/js/custom_js.js @@ -26,7 +26,19 @@ CustomJs.include({ } lang_list += '' + ' ' + lang['name'] + ' ' + a +''; }); - self.$('switch-lang').replaceWith(lang_list); + // self.$('switch-lang').replaceWith(lang_list); + + // keeping the language switcher on mobile sidebar + self.$el.find('switch-lang').each(function () { + $(this).replaceWith(lang_list); + }); + + // add language switcher for main user dropdown + self.$el.on('shown.bs.dropdown', function () { + if (!self.$('.dropdown-menu-right').find('[data-lang-menu]').length) { + self.$('.dropdown-menu-right .dropdown-divider').after(lang_list); + } + }); }) }, start: function () {