Skip to content

Commit da5e891

Browse files
committed
v8.0.15
1 parent dca97bf commit da5e891

File tree

7 files changed

+51
-34
lines changed

7 files changed

+51
-34
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.14",
3+
"version": "8.0.15",
44
"main": "build/index.js",
55
"scripts": {
66
"start": "webpack serve",

published/8.0.15/index.js

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

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/Gleap.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,18 @@ class Gleap {
377377
buttonColor,
378378
backgroundColor = "#ffffff",
379379
borderRadius = 20,
380+
buttonX = 20,
381+
buttonY = 20
380382
) {
381383
runFunctionWhenDomIsReady(() => {
382384
injectStyledCSS(
383385
primaryColor,
384386
headerColor,
385387
buttonColor,
386388
borderRadius,
387-
backgroundColor
389+
backgroundColor,
390+
buttonX,
391+
buttonY
388392
);
389393
});
390394
}

src/GleapConfigManager.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import { loadFromGleapCache, saveToGleapCache } from "./GleapHelper";
22
import Gleap, { GleapFrameManager, GleapFeedbackButtonManager, GleapTranslationManager, GleapNetworkIntercepter, GleapSession, GleapReplayRecorder, GleapNotificationManager } from "./Gleap";
33

4+
const parseIntWithDefault = (val, def) => {
5+
const parsed = parseInt(val);
6+
if (isNaN(parsed)) {
7+
return def;
8+
}
9+
return parsed;
10+
}
11+
412
export default class GleapConfigManager {
513
flowConfig = null;
614
projectActions = null;
@@ -89,7 +97,9 @@ export default class GleapConfigManager {
8997
flowConfig.backgroundColor
9098
? flowConfig.backgroundColor
9199
: "#FFFFFF",
92-
flowConfig.borderRadius,
100+
parseIntWithDefault(flowConfig.borderRadius, 20),
101+
parseIntWithDefault(flowConfig.buttonX, 20),
102+
parseIntWithDefault(flowConfig.buttonY, 20),
93103
);
94104
}
95105

src/UI.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export const injectStyledCSS = (
3636
headerColor,
3737
buttonColor,
3838
borderRadius,
39-
backgroundColor
39+
backgroundColor,
40+
buttonX,
41+
buttonY
4042
) => {
4143
const contrastColor = calculateContrast(primaryColor);
4244
const contrastButtonColor = calculateContrast(buttonColor);
@@ -60,8 +62,8 @@ export const injectStyledCSS = (
6062

6163
const colorStyleSheet = `
6264
.gleap-frame-container {
63-
right: 20px;
64-
bottom: 95px;
65+
right: ${buttonX}px;
66+
bottom: ${75 + buttonY}px;
6567
width: 375px;
6668
position: fixed;
6769
z-index: ${zIndexBase + 31};
@@ -78,12 +80,12 @@ export const injectStyledCSS = (
7880
7981
[dir=rtl].gleap-frame-container {
8082
right: auto;
81-
left: 20px;
82-
bottom: 95px;
83+
left: ${buttonX}px;
84+
bottom: ${75 + buttonY}px;
8385
}
8486
8587
.gleap-frame-container--survey {
86-
bottom: 20px !important;
88+
bottom: ${buttonY}px !important;
8789
}
8890
8991
.gleap-frame-container--survey-full {
@@ -112,38 +114,38 @@ export const injectStyledCSS = (
112114
}
113115
114116
.gleap-frame-container--classic {
115-
right: 20px;
116-
bottom: 20px;
117+
right: ${buttonX}px;
118+
bottom: ${buttonY}px;
117119
}
118120
119121
[dir=rtl].gleap-frame-container--classic {
120122
right: auto;
121-
left: 20px;
122-
bottom: 20px;
123+
left: ${buttonX}px;
124+
bottom: ${buttonY}px;
123125
}
124126
125127
.gleap-frame-container--classic-left {
126128
right: auto;
127-
left: 20px;
128-
bottom: 20px;
129+
left: ${buttonX}px;
130+
bottom: ${buttonY}px;
129131
}
130132
131133
[dir=rtl].gleap-frame-container--classic-left {
132134
left: auto;
133-
right: 20px;
134-
bottom: 20px;
135+
right: ${buttonX}px;
136+
bottom: ${buttonY}px;
135137
}
136138
137139
.gleap-frame-container--modern-left {
138140
right: auto;
139-
left: 20px;
140-
bottom: 95px;
141+
left: ${buttonX}px;
142+
bottom: ${75 + buttonY}px;
141143
}
142144
143145
[dir=rtl].gleap-frame-container--modern-left {
144146
left: auto;
145-
right: 20px;
146-
bottom: 95px;
147+
right: ${buttonX}px;
148+
bottom: ${75 + buttonY}px;
147149
}
148150
149151
.gleap-frame-container--animate {
@@ -236,7 +238,7 @@ export const injectStyledCSS = (
236238
.gleap-frame-container-inner {
237239
position: relative;
238240
width: 100%;
239-
height: calc(100vh - 150px);
241+
height: calc(100vh - ${130 + buttonY}px);
240242
max-height: ${widgetMaxHeight}px;
241243
}
242244
@@ -266,8 +268,8 @@ export const injectStyledCSS = (
266268
.bb-feedback-button {
267269
margin: 0px;
268270
position: fixed;
269-
bottom: 20px;
270-
right: 20px;
271+
bottom: ${buttonY}px;
272+
right: ${buttonX}px;
271273
border-radius: 30px;
272274
cursor: pointer;
273275
-webkit-tap-highlight-color: transparent;
@@ -281,20 +283,20 @@ export const injectStyledCSS = (
281283
}
282284
283285
[dir=rtl].bb-feedback-button {
284-
bottom: 20px;
286+
bottom: ${buttonY}px;
285287
right: auto;
286-
left: 20px;
288+
left: ${buttonX}px;
287289
}
288290
289291
.bb-feedback-button--bottomleft {
290-
bottom: 20px;
292+
bottom: ${buttonY}px;
291293
right: auto;
292-
left: 20px;
294+
left: ${buttonX}px;
293295
}
294296
295297
[dir=rtl].bb-feedback-button--bottomleft {
296-
bottom: 20px;
297-
right: 20px;
298+
bottom: ${buttonY}px;
299+
right: ${buttonX}px;
298300
left: auto;
299301
}
300302
@@ -441,15 +443,15 @@ export const injectStyledCSS = (
441443
top: auto;
442444
bottom: 0px;
443445
transform: none;
444-
right: 20px;
446+
right: ${buttonX}px;
445447
left: auto;
446448
}
447449
448450
[dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {
449451
top: auto;
450452
bottom: 0px;
451453
transform: none;
452-
left: 20px;
454+
left: ${buttonX}px;
453455
right: auto;
454456
}
455457

0 commit comments

Comments
 (0)