mirror of
https://github.com/rio-labs/rio.git
synced 2026-01-05 20:59:46 -06:00
fix revealer animating its initial state
This commit is contained in:
committed by
Jakob Pinterits
parent
0cdc77dace
commit
fbff275a38
@@ -148,10 +148,21 @@ export class RevealerComponent extends ComponentBase {
|
||||
|
||||
// Expand / collapse
|
||||
if (deltaState.is_open !== undefined) {
|
||||
if (deltaState.is_open) {
|
||||
this.animateOpen();
|
||||
// If this component has only just been created, then skip the
|
||||
// animation and render the final result immediately
|
||||
if (this.contentOuterElement.style.maxHeight === '') {
|
||||
if (deltaState.is_open) {
|
||||
this.element.classList.add('rio-revealer-open');
|
||||
this.contentOuterElement.style.maxHeight = 'unset';
|
||||
} else {
|
||||
this.contentOuterElement.style.maxHeight = '0';
|
||||
}
|
||||
} else {
|
||||
this.animateClose();
|
||||
if (deltaState.is_open) {
|
||||
this.animateOpen();
|
||||
} else {
|
||||
this.animateClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user