forked from Wavyzz/dolibarr
WIP : Documentation ux (#30735)
* Move documentation files to new folder * Documentation prototype Create a documentation class and views * Remove whitespace and add functions returns * Remove Google fonts * Remove return string * Phpcbf corrections * Phpcdf with good ruleset * add return null * resolve conflict with test_arrays.php * Return void for print functions * WIP progress bar * Add seteventmessage documentation for ui/ux * Add translations * Delete is of button * Clean titles * Change name of file event-message.php * Update before moving and rename files * Remove fr_FR lang file (all in en_US for the moment) * Add some css * Menu definition updated * Add jQuery, lib_head.js and lib_foot.js * Add missing button * Add missing button * move ui doc files * Remove old documentation files * Reupload test_arrays.php * Rename lang file * Move lang file * add htmlhead * Add parameter comment * Update tables.php * Update uxdocumentation.lang * Update tables.php * Update uxdocumentation.lang * Update progress-bars.php * Update tables.php --------- Co-authored-by: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Co-authored-by: atm-lena <lena.papazian@atm-consulting.fr> Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
31
htdocs/admin/tools/ui/js/documentation.js
Normal file
31
htdocs/admin/tools/ui/js/documentation.js
Normal file
@@ -0,0 +1,31 @@
|
||||
// MENU
|
||||
let navmenu = document.querySelector('.doc-sidebar nav ul');
|
||||
let navmenulinks = navmenu.querySelectorAll('a.link-withsubmenu');
|
||||
if(navmenulinks.length > 0) {
|
||||
navmenulinks.forEach(
|
||||
function (menulink) {
|
||||
menulink.addEventListener(
|
||||
'click', function (e) {
|
||||
e.preventDefault();
|
||||
if(menulink.parentNode.classList.contains('active')) {
|
||||
menulink.parentNode.classList.remove('active');
|
||||
} else {
|
||||
menulink.parentNode.classList.add('active');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// VIEW SCROLL
|
||||
window.onscroll = function () {
|
||||
showscroll()
|
||||
};
|
||||
function showscroll()
|
||||
{
|
||||
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
|
||||
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
|
||||
var scrolled = (winScroll / height) * 100;
|
||||
document.getElementById("documentation-scroll").style.width = scrolled + "%";
|
||||
}
|
||||
Reference in New Issue
Block a user