Skip to content

Commit

Permalink
v7.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed May 30, 2022
1 parent 8059ba1 commit 9f512e8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "7.0.6",
"version": "7.0.7",
"main": "build/index.js",
"scripts": {
"start": "webpack serve",
Expand Down
1 change: 1 addition & 0 deletions published/7.0.7/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/GleapFrameManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ export default class GleapFrameManager {
showWidget() {
if (this.gleapFrameContainer.classList) {
this.gleapFrameContainer.classList.remove('gleap-frame-container--hidden');

setTimeout(() => {
this.gleapFrameContainer.classList.add('gleap-frame-container--animate');
}, 500);
}

this.widgetOpened = true;
GleapFeedbackButtonManager.getInstance().updateFeedbackButtonState();
GleapEventManager.notifyEvent("open");
Expand All @@ -117,6 +122,7 @@ export default class GleapFrameManager {
this.hideMarkerManager();
if (this.gleapFrameContainer) {
this.gleapFrameContainer.classList.add('gleap-frame-container--hidden');
this.gleapFrameContainer.classList.remove('gleap-frame-container--animate');
}
this.widgetOpened = false;
GleapFeedbackButtonManager.getInstance().updateFeedbackButtonState();
Expand Down
11 changes: 7 additions & 4 deletions src/GleapTranslationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,19 @@ export default class GleapTranslationManager {
static translateText(key) {
const instance = GleapTranslationManager.getInstance();

var language = navigator.language;
if (instance.overrideLanguage !== "") {
language = instance.overrideLanguage;
var language = "en";
if (typeof navigator !== "undefined") {
navigator.language.substring(0, 2).toLowerCase();
}
if (instance.overrideLanguage && instance.overrideLanguage !== "") {
language = instance.overrideLanguage.toLowerCase();
}

var customTranslation = {};
const translationKeys = Object.keys(instance.customTranslation);
for (var i = 0; i < translationKeys.length; i++) {
const translationKey = translationKeys[i];
if (language && language.includes(translationKey)) {
if (language && translationKey && language === translationKey.toLowerCase()) {
if (instance.customTranslation[translationKey]) {
customTranslation = instance.customTranslation[translationKey];
}
Expand Down
7 changes: 5 additions & 2 deletions src/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ export const injectStyledCSS = (
box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.16);
border-radius: ${borderRadius}px;
overflow: hidden;
transition: max-height 0.3s ease-in;
animation-duration: .3s;
animation-fill-mode: both;
animation-name: gleapFadeInUp;
user-select: none;
}
.gleap-frame-container--animate {
transition: max-height 0.3s ease-in;
}
@keyframes gleapFadeInUp {
from {
opacity: 0;
Expand Down Expand Up @@ -132,7 +135,7 @@ export const injectStyledCSS = (
}
.gleap-frame-container--hidden {
opacity: 0;
display: none !important;
pointer-events: none;
animation: none !important;
}
Expand Down

0 comments on commit 9f512e8

Please sign in to comment.