forked from Wavyzz/dolibarr
Fix: closing of butAction dropdown was also closing the login dropdown
when we just lick inside a link into login dropdown.
This commit is contained in:
@@ -1333,7 +1333,8 @@ jQuery(document).ready(function() {
|
||||
if (widthPopup + right >= widthDocument) {
|
||||
//right = 10;
|
||||
}
|
||||
parentHolder.toggleClass("open");
|
||||
|
||||
parentHolder.toggleClass("open"); /* If open, it closes, if closed, it opens */
|
||||
|
||||
// Check tooltip is in viewport
|
||||
let dropDownContentTop = dropDownContent.offset().top;
|
||||
@@ -1363,8 +1364,9 @@ jQuery(document).ready(function() {
|
||||
// Close drop down
|
||||
jQuery(document).on("click", function(event) {
|
||||
// search if click was outside drop down
|
||||
if (!$(event.target).closest('.dropdown-toggle').length) {
|
||||
let parentholder = jQuery(".dropdown-toggle").closest(".dropdown.open");
|
||||
if (!$(event.target).closest('.butAction.dropdown-toggle').length) {
|
||||
/* console.log("click close butAction - we click outside"); */
|
||||
let parentholder = jQuery(".butAction.dropdown-toggle").closest(".dropdown.open");
|
||||
if (parentholder){
|
||||
// Hide the menus.
|
||||
parentholder.removeClass("open --up --left");
|
||||
|
||||
@@ -2735,14 +2735,14 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
<!-- Code to show/hide the user drop-down -->
|
||||
<script>
|
||||
function closeTopMenuLoginDropdown() {
|
||||
//console.log("close login dropdown"); // This is call at each click on page, so we disable the log
|
||||
console.log("close login dropdown"); // This is called at each click on page, so we disable the log
|
||||
// Hide the menus.
|
||||
jQuery("#topmenu-login-dropdown").removeClass("open");
|
||||
}
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(document).on("click", function(event) {
|
||||
// console.log("Click somewhere on screen");
|
||||
if (!$(event.target).closest("#topmenu-login-dropdown").length) {
|
||||
/* console.log("click close login - we click outside"); */
|
||||
closeTopMenuLoginDropdown();
|
||||
}
|
||||
});
|
||||
@@ -2821,6 +2821,7 @@ function top_menu_quickadd()
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(document).on("click", function(event) {
|
||||
if (!$(event.target).closest("#topmenu-quickadd-dropdown").length) {
|
||||
/* console.log("click close quick add - we click outside"); */
|
||||
// Hide the menus.
|
||||
$("#topmenu-quickadd-dropdown").removeClass("open");
|
||||
}
|
||||
@@ -3093,7 +3094,7 @@ function top_menu_bookmark()
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(document).on("click", function(event) {
|
||||
if (!$(event.target).closest("#topmenu-bookmark-dropdown").length) {
|
||||
//console.log("close bookmark dropdown - we click outside");
|
||||
/* console.log("close bookmark dropdown - we click outside"); */
|
||||
// Hide the menus.
|
||||
$("#topmenu-bookmark-dropdown").removeClass("open");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user