mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-01 21:23:12 +00:00
Make arrows change directions when switching collapse state
This commit is contained in:
@@ -395,8 +395,10 @@ function generateObject(data, struct, header) {
|
||||
}
|
||||
for (let field of struct.fields) {
|
||||
if (field.collapse) {
|
||||
$body.append('<button type="button" class="btn btn-light mt-3 dropdown-toggle" onclick="toggleCollapseObject(this)" data-index="' + field.id + '" data-i18n="' + field.translate + '"></button>');
|
||||
if (data[field.id] === undefined) {
|
||||
let hasNoValue = data[field.id] === undefined
|
||||
let arrowDirection = hasNoValue ? 'dropright' : 'dropdown'
|
||||
$body.append('<span class="' + arrowDirection + '"><button type="button" class="btn btn-light mt-3 dropdown-toggle" onclick="toggleCollapseObject(this)" data-index="' + field.id + '" data-i18n="' + field.translate + '"></button></span>');
|
||||
if (hasNoValue) {
|
||||
$body.append('<div/>');
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user