Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 86caecb975f75371b1d8b46bfbd6fbb7bb1082de
Author: eunji9128 <eunji9128@gmail.com>
Date:   Tue Dec 31 14:23:14 2024 +0900

    fix: blocking expanded button when clicking floating button
  • Loading branch information
eunji9128 committed Dec 31, 2024
1 parent a6008a7 commit 822c962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion floating-button-sdk-cafe24.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FloatingButton {
this.isDestroyed = false;
this.isInitialized = false; // Add flag to track initialization
this.floatingCount = 0;
this.floatingClicked = false;
this.itemId = this.getProductNo();
console.log('itemId, displayLocation @ constructor', this.itemId, this.displayLocation);

Expand Down Expand Up @@ -216,7 +217,7 @@ class FloatingButton {
// type: this.type,
// });

if(this.floatingCount < 2 && this.floatingData.comment.length > 0) {
if(this.floatingCount < 2 && this.floatingData.comment.length > 0 && !this.floatingClicked) {
setTimeout(() => {
this.expandedButton = document.createElement('div');
this.expandedButton.className = 'expanded-area';
Expand Down Expand Up @@ -261,6 +262,7 @@ class FloatingButton {
var buttonClickHandler = (e) => {
e.stopPropagation();
e.preventDefault();
this.floatingClicked = true;
if (this.iframeContainer.classList.contains('iframe-container-hide')) {
if (this.expandedButton) this.expandedButton.className = 'expanded-area hide';
this.button.className = 'floating-button-common button-image-close-mr hide-visibility';
Expand Down

0 comments on commit 822c962

Please sign in to comment.