2
0
forked from Wavyzz/dolibarr

FIX Menu Create of project no working on smartphone with no top menu.

This commit is contained in:
Laurent Destailleur
2023-12-19 22:32:49 +01:00
parent 30465fdac8
commit 9892abdbb2
2 changed files with 20 additions and 16 deletions

View File

@@ -1299,6 +1299,7 @@ $(document).ready(function() {
});
<?php } ?>
jQuery(document).ready(function() {
// Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup
if (window.location && window.location.pathname.indexOf("externalsite/frametop.php") == -1 && window.location !== window.parent.location ) {
@@ -1314,6 +1315,25 @@ jQuery(document).ready(function() {
});
jQuery(document).ready(function() {
jQuery(".butAction.dropdown-toggle").on("click", function(event) {
console.log("Click on .butAction.dropdown-toggle");
var parentholder = jQuery(".butAction.dropdown-toggle").closest(".dropdown");
var offset = parentholder.offset();
var widthdocument = $(document).width();
var left = offset.left;
var right = widthdocument - offset.left - parentholder.width();
var widthpopup = parentholder.children(".dropdown-content").width();
console.log("left="+left+" right="+right+" width="+widthpopup+" widthdocument="+widthdocument);
if (widthpopup + right >= widthdocument) {
right = 10;
}
parentholder.toggleClass("open");
parentholder.children(".dropdown-content").css({"right": right+"px", "left": "auto"});
});
});
/*
* Hacky fix for a bug in select2 with jQuery 3.6.0's new nested-focus "protection"
* see: https://github.com/select2/select2/issues/5993