This commit is contained in:
2024-01-31 11:36:25 +07:00
parent caef156a05
commit 4561bd68d1
125 changed files with 9117 additions and 58 deletions

View File

@@ -0,0 +1,44 @@
const RowExpand = (function (){
const $status_expand_all = $("#js-row-expand-all");
let track_open_rows = [];
function open_child_row(child_class_name){
const $children = $(`.${child_class_name}`);
if(!track_open_rows.includes(child_class_name)) {
$children.css('display', 'table-row');
track_open_rows.push(child_class_name);
}else{
$children.css('display', 'none');
track_open_rows = [...Util.removeItemFromArray(track_open_rows, child_class_name)];
}
}
function open_all_row(){
if(!track_open_rows.includes('expand_all')) {
$(".row").css('display', 'table-row');
track_open_rows.push('expand_all');
$status_expand_all.html("[-]");
}else{
// collapse all
$(".row").css('display', 'none');
// open only first parent
$(".parent_0").css('display', 'table-row');
track_open_rows = [];
$status_expand_all.html("[+]");
}
}
return {
open_child: open_child_row,
open_all: open_all_row
}
})();