Theme - Fixed Menu: Add new user menu to menu bar.

This commit is contained in:
fusionate
2024-10-07 14:36:55 -06:00
parent 1134341635
commit b498af4cf4
4 changed files with 93 additions and 23 deletions

View File

@@ -244,10 +244,11 @@
//domain selector controls
{if $domain_selector_enabled}
{literal}
$('#header_domain_selector_domain').on('click', function() { event.preventDefault(); show_domains(); });
$('.header_domain_selector_domain').on('click', function() { event.preventDefault(); show_domains(); });
$('#domains_hide').on('click', function() { hide_domains(); });
function show_domains() {
$('#body_header_user_menu').fadeOut(200);
search_domains('domains_list');
$('#domains_visible').val(1);
@@ -683,22 +684,30 @@
{literal}
}
});
{/literal}
{/if}
//hide an open user menu in the body header on scroll
//side/fixed menu: hide an open user menu in the body header or menu on scroll
{if $settings.theme.menu_style == 'side' || $settings.theme.menu_style == 'fixed' }
{literal}
$(window).on('scroll', function() {
$('#body_header_user_menu').fadeOut(200);
});
//create function to mimic toggling fade and slide at the same time
(function($){
$.fn.toggleFadeSlide = function(speed = 200, easing, callback){
return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
};
})(jQuery);
$('div#main_content').on('click', function() {
$('#body_header_user_menu').fadeOut(200);
});
{/literal}
{/if}
//create function to mimic toggling fade and slide at the same time
{literal}
(function($){
$.fn.toggleFadeSlide = function(speed = 200, easing, callback){
return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
};
})(jQuery);
{/literal}
{literal}
}); //document ready end
{/literal}