Skip to content

Commit b0b0975

Browse files
committed
v8.0.21
1 parent 9338d2c commit b0b0975

File tree

5 files changed

+43
-6
lines changed

5 files changed

+43
-6
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "8.0.20",
3+
"version": "8.0.21",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GleapNotificationManager.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Gleap, { GleapFeedbackButtonManager, GleapConfigManager, GleapFrameManager, GleapSession } from "./Gleap";
22
import { loadFromGleapCache, saveToGleapCache } from "./GleapHelper";
3+
import { loadIcon } from "./UI";
34

45
export default class GleapNotificationManager {
56
notificationContainer = null;
@@ -78,6 +79,15 @@ export default class GleapNotificationManager {
7879
// Clear the existing notifications.
7980
this.clearAllNotifications(true);
8081

82+
// Append close button.
83+
const clearElem = document.createElement("div");
84+
clearElem.onclick = () => {
85+
this.clearAllNotifications();
86+
};
87+
clearElem.className = "gleap-notification-close";
88+
clearElem.innerHTML = loadIcon("dismiss");
89+
this.notificationContainer.appendChild(clearElem);
90+
8191
// Render the notifications.
8292
for (var i = 0; i < this.notifications.length; i++) {
8393
const notification = this.notifications[i];

src/UI.js

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,35 @@ export const injectStyledCSS = (
208208
animation-name: bbFadeInOpacity;
209209
}
210210
211+
.gleap-notification-close {
212+
border-radius: 100%;
213+
width: 30px;
214+
height: 30px;
215+
background-color: ${subTextColor};
216+
display: flex;
217+
justify-content: center;
218+
align-items: center;
219+
margin-bottom: 8px;
220+
cursor: pointer;
221+
visibility: hidden;
222+
pointer-events: none;
223+
}
224+
225+
.gleap-notification-container:hover .gleap-notification-close {
226+
visibility: visible;
227+
pointer-events: auto;
228+
animation-duration: 0.7s;
229+
animation-fill-mode: both;
230+
animation-name: bbFadeInOpacity;
231+
}
232+
233+
.gleap-notification-close svg {
234+
width: 45%;
235+
height: 45%;
236+
object-fit: contain;
237+
fill: ${backgroundColor};
238+
}
239+
211240
.gleap-notification-item {
212241
display: flex;
213242
align-items: flex-end;
@@ -1185,9 +1214,7 @@ export const loadIcon = function (name, color) {
11851214
}
11861215

11871216
if (name === "dismiss") {
1188-
return `<svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">
1189-
<path d="m684 600 439.2-439.2c22.801-22.801 22.801-60 0-84s-60-22.801-84 0l-439.2 439.2-439.2-439.2c-22.801-22.801-60-22.801-84 0s-22.801 60 0 84l439.2 439.2-439.2 439.2c-22.801 22.801-22.801 60 0 84 12 12 26.398 16.801 42 16.801 15.602 0 30-6 42-16.801l439.2-439.2 439.2 439.2c12 12 26.398 16.801 42 16.801 15.602 0 30-6 42-16.801 22.801-22.801 22.801-60 0-84z" fill="#333"/>
1190-
</svg>`;
1217+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M294.6 166.6L317.3 144 272 98.7l-22.6 22.6L160 210.7 70.6 121.4 48 98.7 2.7 144l22.6 22.6L114.7 256 25.4 345.4 2.7 368 48 413.3l22.6-22.6L160 301.3l89.4 89.4L272 413.3 317.3 368l-22.6-22.6L205.3 256l89.4-89.4z"/></svg>`;
11911218
}
11921219

11931220
if (name === "blur") {

0 commit comments

Comments
 (0)