mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 02:59:13 +00:00
chore: minor refactor
This commit is contained in:
@@ -118,14 +118,14 @@ export default class SlTree extends LitElement {
|
||||
.forEach((status: 'expanded' | 'collapsed') => {
|
||||
const existingIcon = item.querySelector(`[slot="${status}-icon"]`);
|
||||
|
||||
if (existingIcon !== null && !existingIcon.hasAttribute('data-default')) {
|
||||
// The user provided a custom icon, leave it alone
|
||||
} else if (existingIcon === null) {
|
||||
if (existingIcon === null) {
|
||||
// No separator exists, add one
|
||||
item.append(this.getExpandButtonIcon(status)!);
|
||||
} else if (existingIcon.hasAttribute('data-default')) {
|
||||
// A default separator exists, replace it
|
||||
existingIcon.replaceWith(this.getExpandButtonIcon(status)!);
|
||||
} else {
|
||||
// The user provided a custom icon, leave it alone
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user