@product7/feedback-sdk 1.2.2 → 1.2.3
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.
package/dist/feedback-sdk.js
CHANGED
|
@@ -1360,7 +1360,7 @@
|
|
|
1360
1360
|
this.isMinimized = false;
|
|
1361
1361
|
}
|
|
1362
1362
|
|
|
1363
|
-
|
|
1363
|
+
render() {
|
|
1364
1364
|
const button = document.createElement('div');
|
|
1365
1365
|
button.className = `feedback-widget feedback-widget-button theme-${this.options.theme} position-${this.options.position}`;
|
|
1366
1366
|
button.innerHTML = `
|
|
@@ -1391,25 +1391,34 @@
|
|
|
1391
1391
|
return button;
|
|
1392
1392
|
}
|
|
1393
1393
|
|
|
1394
|
-
|
|
1394
|
+
attachEvents() {
|
|
1395
1395
|
const button = this.element.querySelector('.feedback-trigger-btn');
|
|
1396
|
-
this.element.querySelector('.feedback-minimize-icon');
|
|
1397
|
-
this.element.querySelector('.feedback-expand-icon');
|
|
1396
|
+
const minimizeIcon = this.element.querySelector('.feedback-minimize-icon');
|
|
1397
|
+
const expandIcon = this.element.querySelector('.feedback-expand-icon');
|
|
1398
|
+
|
|
1399
|
+
// Add click handlers directly to the icons
|
|
1400
|
+
minimizeIcon.addEventListener('click', (e) => {
|
|
1401
|
+
e.stopPropagation();
|
|
1402
|
+
e.preventDefault();
|
|
1403
|
+
this.minimize();
|
|
1404
|
+
});
|
|
1405
|
+
|
|
1406
|
+
expandIcon.addEventListener('click', (e) => {
|
|
1407
|
+
e.stopPropagation();
|
|
1408
|
+
e.preventDefault();
|
|
1409
|
+
this.restore();
|
|
1410
|
+
});
|
|
1398
1411
|
|
|
1412
|
+
// Main button click handler
|
|
1399
1413
|
button.addEventListener('click', (e) => {
|
|
1400
|
-
|
|
1401
|
-
|
|
1414
|
+
// Check if the click originated from an icon
|
|
1415
|
+
if (e.target.closest('.feedback-minimize-icon') ||
|
|
1416
|
+
e.target.closest('.feedback-expand-icon')) {
|
|
1417
|
+
return; // Let the icon handlers deal with it
|
|
1418
|
+
}
|
|
1402
1419
|
|
|
1403
|
-
if (
|
|
1404
|
-
|
|
1405
|
-
this.minimize();
|
|
1406
|
-
} else if (clickedExpand) {
|
|
1407
|
-
e.stopPropagation();
|
|
1408
|
-
this.restore();
|
|
1409
|
-
} else {
|
|
1410
|
-
if (!this.isMinimized) {
|
|
1411
|
-
this.openPanel();
|
|
1412
|
-
}
|
|
1420
|
+
if (!this.isMinimized) {
|
|
1421
|
+
this.openPanel();
|
|
1413
1422
|
}
|
|
1414
1423
|
});
|
|
1415
1424
|
|