Merge pull request #684 from expsa/dev_base_temp

add lang switcher on main user dropdown
This commit is contained in:
MohamedGad100 2024-08-13 12:27:15 +03:00 committed by GitHub
commit 6ac9edad33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 1 deletions

View File

@ -26,7 +26,19 @@ CustomJs.include({
}
lang_list += '<a href="#" class="dropdown-item" data-lang-menu="lang" data-lang-id="' + lang['code'] + '"><img class="flag" src="quick_language_selection/static/src/img/flags/' + lang['code'] + '.png"/>' + ' ' + lang['name'] + ' ' + a +'</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 () {