Skip to content

Commit

Permalink
correct display for container
Browse files Browse the repository at this point in the history
  • Loading branch information
dealfonso committed Jun 16, 2023
1 parent 187a343 commit 51ea15c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion js/simplelottieplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ class SimpleLottiePlayer {
return node;
}

// The container must have relative position so that the overlays appear appropriately
this._container.style.display = "block";

// Remove the event handler, if set
if (this._buttonEventHandler !== null) {
this._container.removeEventListener("click", this._buttonEventHandler);
Expand Down Expand Up @@ -219,7 +222,6 @@ class SimpleLottiePlayer {

// The container must have relative position so that the overlays appear appropriately
this._container.style.position = "relative";
this._container.style.display = "block";

let player = this;
fullScreenBtn.addEventListener('click', function(event) {
Expand Down
2 changes: 1 addition & 1 deletion simplelottieplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ class SimpleLottiePlayer {
}
return node;
}
this._container.style.display = "block";
if (this._buttonEventHandler !== null) {
this._container.removeEventListener("click", this._buttonEventHandler);
this._buttonEventHandler = null;
Expand Down Expand Up @@ -337,7 +338,6 @@ class SimpleLottiePlayer {
this._container.prepend(fullScreenBtn);
this._container.prepend(exitFullScreenBtn);
this._container.style.position = "relative";
this._container.style.display = "block";
let player = this;
fullScreenBtn.addEventListener("click", function(event) {
player.resize(player._animationData["w"], player._animationData["h"], true);
Expand Down
Loading

0 comments on commit 51ea15c

Please sign in to comment.