mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-29 18:16:17 +01:00 
			
		
		
		
	fix: persona tooltip so it doesn't appear when dropdowns are open
This commit is contained in:
		| @@ -110,7 +110,7 @@ | ||||
|         "nodebb-theme-harmony": "2.1.10", | ||||
|         "nodebb-theme-lavender": "7.1.18", | ||||
|         "nodebb-theme-peace": "2.2.40", | ||||
|         "nodebb-theme-persona": "14.1.8", | ||||
|         "nodebb-theme-persona": "14.1.9", | ||||
|         "nodebb-widget-essentials": "7.0.36", | ||||
|         "nodemailer": "6.10.1", | ||||
|         "nprogress": "0.2.0", | ||||
|   | ||||
| @@ -44,12 +44,24 @@ define('forum/header', [ | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		$('#header-menu #main-nav').tooltip({ | ||||
| 			selector: '.nav-item', | ||||
| 			placement: 'bottom', | ||||
| 			trigger: 'hover', | ||||
| 			container: 'body', | ||||
| 		// only affects persona, harmony uses a different structure in harmony.js | ||||
| 		const tooltipEls = $('#header-menu .nav-item[title]'); | ||||
|  | ||||
| 		tooltipEls.tooltip({ | ||||
| 			trigger: 'manual', | ||||
| 			animation: false, | ||||
| 			placement: 'bottom', | ||||
| 		}); | ||||
|  | ||||
| 		tooltipEls.on('mouseenter', function (ev) { | ||||
| 			const target = $(ev.target); | ||||
| 			const isDropdown = target.hasClass('dropdown-menu') || !!target.parents('.dropdown-menu').length; | ||||
| 			if (!isDropdown) { | ||||
| 				$(this).tooltip('show'); | ||||
| 			} | ||||
| 		}); | ||||
| 		tooltipEls.on('click mouseleave', function () { | ||||
| 			$(this).tooltip('hide'); | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user