Skip to content

Commit

Permalink
add missing options to acordion item.
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed May 7, 2024
1 parent 8d09fd0 commit 32f422f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,17 @@ public class AccordionItem extends BaseComponent {
@Inject
@Getter
@Default(values = "Accordion Item ")
private String title;
public String title;

@Getter
@Inject
@Nullable
private Boolean show;
@Default(values = "false")
public Boolean showopen;

@Getter
@Inject
@Default(values = "false")
public Boolean alwaysopen;


@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@
See the License for the specific language governing permissions and
limitations under the License.
*/-->
<!-- new -->
<sly data-sly-use.model="ai.typerefinery.websight.models.components.layout.AccordionItem">
<div class="accordion-item"
data-sly-set.expand="${wcmmode.isEdit || model.show}">
data-sly-set.expand="${wcmmode.isEdit || model.showopen}">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${model.show ? 'true' : ''}" aria-controls="${model.id}">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#${model.id}" aria-expanded="${model.showopen ? 'true' : ''}" aria-controls="${model.id}">
${model.title}
</button>
</h2>
<!--${expand}-->
<div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="#${resource.parent.id}">
<sly data-sly-set.parentid="#${resource.parent.id}"></sly>
<div id="${model.id}" class="accordion-collapse collapse ${expand ? 'show' : ''}" data-bs-parent="${model.alwaysopen ? '' : parentid }">
<div class="accordion-body">
<sly data-sly-include="${'parsys.html' @ prependPath='/libs/wcm/foundation/components/parsys'}">
</sly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@
},
"enable": {
"sling:resourceType": "wcm/dialogs/components/checkbox",
"name": "show",
"name": "showopen",
"label": "Show Open"
},
"alwaysopen": {
"sling:resourceType": "wcm/dialogs/components/checkbox",
"name": "alwaysopen",
"label": "Always Open"
}
},
"styleTab": {
Expand Down

0 comments on commit 32f422f

Please sign in to comment.