30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
;
|
|
var LanguageSelectorManager = new function() {
|
|
var init = function() {
|
|
$('div.custom-select').hover(function() { $(this).css('background', 'none'); }, function() { $(this).css('background', 'none'); });
|
|
};
|
|
|
|
var openLngSelector = function () {
|
|
if (!$('#LanguageSelector').hasClass('open')) {
|
|
|
|
$('div.custom-select').unbind('mouseenter mouseleave');
|
|
$('div.custom-select').css('background', 'none');
|
|
|
|
$('#LanguageSelector ul.options:first').slideDown(10, function () {
|
|
$('#LanguageSelector').addClass('open');
|
|
$(document).one('click', function () {
|
|
$('div.custom-select').css('background', 'none');
|
|
init();
|
|
|
|
$('#LanguageSelector ul.options:first').hide();
|
|
$('#LanguageSelector').removeClass('open');
|
|
});
|
|
});
|
|
}
|
|
};
|
|
|
|
return {
|
|
init: init,
|
|
openLngSelector: openLngSelector
|
|
};
|
|
}; |