releasebird-javascript-sdk 1.0.89 → 1.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -990,6 +990,12 @@ export default class RbirdWebsiteWidget {
990
990
  }, 50);
991
991
  return true;
992
992
  }
993
+
994
+ // Even without saved position, update hide button position after DOM is ready
995
+ setTimeout(() => {
996
+ this.updateRelatedElementsPosition();
997
+ }, 50);
998
+
993
999
  return false;
994
1000
  }
995
1001
 
@@ -1001,9 +1007,16 @@ export default class RbirdWebsiteWidget {
1001
1007
 
1002
1008
  const buttonRect = this.websiteWidget.getBoundingClientRect();
1003
1009
 
1004
- // Check if we have a custom position (not default)
1010
+ // Update hide button position (top right of bubble)
1011
+ if (this.hideWidgetButton) {
1012
+ this.hideWidgetButton.style.left = `${buttonRect.right - 5}px`;
1013
+ this.hideWidgetButton.style.right = 'unset';
1014
+ this.hideWidgetButton.style.bottom = `${window.innerHeight - buttonRect.bottom + 55}px`;
1015
+ }
1016
+
1017
+ // Only update badge and bubbles if we have a custom position
1005
1018
  const savedPosition = this.loadWidgetPosition();
1006
- if (!savedPosition) return; // Use default CSS positioning
1019
+ if (!savedPosition) return;
1007
1020
 
1008
1021
  // Update badge position
1009
1022
  if (this.countBadge) {
@@ -1012,16 +1025,6 @@ export default class RbirdWebsiteWidget {
1012
1025
  this.countBadge.style.bottom = `${window.innerHeight - buttonRect.top - 15}px`;
1013
1026
  }
1014
1027
 
1015
- // Update hide button position (top right of bubble)
1016
- // Match CSS: bottom = spaceBottom + 45 = buttonRect.bottom + 45 - buttonRect.height
1017
- // Since buttonRect.top = window.innerHeight - buttonRect.bottom, and bubble height is ~50px
1018
- // bottom = window.innerHeight - buttonRect.top - 5 should equal spaceBottom + 45
1019
- if (this.hideWidgetButton) {
1020
- this.hideWidgetButton.style.left = `${buttonRect.right - 5}px`;
1021
- this.hideWidgetButton.style.right = 'unset';
1022
- this.hideWidgetButton.style.bottom = `${window.innerHeight - buttonRect.bottom + 55}px`;
1023
- }
1024
-
1025
1028
  // Update message bubbles container position
1026
1029
  if (this.messageBubblesContainer) {
1027
1030
  this.positionMessageBubbles();