Code comment
This commit is contained in:
parent
c7bc056aba
commit
729c2da70a
2 changed files with 20 additions and 10 deletions
|
|
@ -148,7 +148,10 @@ if ($thousand == 'Space') {
|
|||
// Javascript libraries for Dolibarr ERP CRM (https://www.dolibarr.org)
|
||||
|
||||
|
||||
// To start/stop Block UI
|
||||
/*
|
||||
* To start/stop Block UI
|
||||
*/
|
||||
|
||||
function dolBlockUI(message = 'Loading...', indicatorUrl = '<?php echo DOL_URL_ROOT."/theme/".$conf->theme."/img/working.gif" ; ?>') {
|
||||
const block = document.getElementById('dol-block-ui');
|
||||
if (block != null) {
|
||||
|
|
@ -165,7 +168,10 @@ function dolUnblockUI() {
|
|||
}
|
||||
|
||||
|
||||
// For jQuery date picker
|
||||
/*
|
||||
* For jQuery date picker
|
||||
*/
|
||||
|
||||
var tradMonths = <?php echo json_encode($tradMonths) ?>;
|
||||
var tradMonthsShort = <?php echo json_encode($tradMonthsShort) ?>;
|
||||
var tradDays = <?php echo json_encode($tradDays) ?>;
|
||||
|
|
@ -295,6 +301,7 @@ function dpChangeDay(dateFieldID, format)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* =================================================================
|
||||
* Function: formatDate(javascript object Date(), format)
|
||||
|
|
@ -356,7 +363,6 @@ function formatDate(date,format)
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* =================================================================
|
||||
* Function: getDateFromFormat(date_string, format_string)
|
||||
|
|
@ -504,6 +510,7 @@ function urlencode(s) {
|
|||
return news;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* =================================================================
|
||||
* Purpose: Clean string to get a HTML coded string.
|
||||
|
|
@ -1379,9 +1386,11 @@ function generateFilterString(column, operator, context, fieldType) {
|
|||
}
|
||||
})();
|
||||
|
||||
|
||||
// Another solution, easier, to build a javascript rounding function
|
||||
function dolroundjs(number, decimals) { return +(Math.round(number + "e+" + decimals) + "e-" + decimals); }
|
||||
|
||||
|
||||
/**
|
||||
* Function similar to PHP price()
|
||||
*
|
||||
|
|
@ -1604,10 +1613,10 @@ jQuery(document).ready(function() {
|
|||
jQuery(document).on("click", function(event) {
|
||||
// search if click was outside drop down
|
||||
if (!$(event.target).closest('.butAction.dropdown-toggle').length) {
|
||||
/* console.log("click close butAction - we click outside"); */
|
||||
/* console.log("click close butAction - we click outside"); // disabled because too verbose */
|
||||
let parentholder = jQuery(".butAction.dropdown-toggle").closest(".dropdown.open");
|
||||
if (parentholder){
|
||||
// Hide the menus.
|
||||
// Hide the dropdown.
|
||||
parentholder.removeClass("open --up --left");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2700,7 +2700,8 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||
jQuery(document).on("click", function(event) {
|
||||
if (jQuery("#topmenu-login-dropdown").hasClass("open")) {
|
||||
if (!$(event.target).closest("#topmenu-login-dropdown").length) {
|
||||
/* console.log("click close login - we click outside"); */
|
||||
/* console.log("click close login - we click outside"); // disabled because too verbose */
|
||||
// Hide the dropdown.
|
||||
closeTopMenuLoginDropdown();
|
||||
}
|
||||
}
|
||||
|
|
@ -2901,8 +2902,8 @@ 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.
|
||||
/* console.log("click close quick add - we click outside"); // disabled because too verbose */
|
||||
// Hide the dropdown.
|
||||
$("#topmenu-quickadd-dropdown").removeClass("open");
|
||||
}
|
||||
});
|
||||
|
|
@ -3365,8 +3366,8 @@ function top_menu_search()
|
|||
// close drop down
|
||||
jQuery(document).on("click", function(event) {
|
||||
if (!$(event.target).closest("#topmenu-global-search-dropdown").length) {
|
||||
console.log("click close search - we click outside");
|
||||
// Hide the menus.
|
||||
/* console.log("click close search - we click outside"); // disabled because too verbose */
|
||||
// Hide the dropdown.
|
||||
jQuery("#topmenu-global-search-dropdown").removeClass("open");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue