globalseo
Advanced tools
Comparing version 2.2.9 to 2.2.10
19
index.js
@@ -77,2 +77,11 @@ const { isBrowser, getGlobalseoOptions, SPECIAL_API_KEYS } = require('./utils/configs.js'); | ||
// remove classname to recreate selectors | ||
elements.forEach(el => { | ||
const details = el.querySelector('details') | ||
if (details) { | ||
details.classList.remove('globalseo-lang-selector-element'); | ||
details.classList.remove('weploy-lang-selector-element'); | ||
} | ||
}) | ||
for(let mutation of mutationsList) { | ||
@@ -101,12 +110,8 @@ if (mutation.type === 'childList') { | ||
if (elements.length && optsArgs.createSelector) { | ||
if (elements.length && optsArgs.createSelector) { | ||
createLanguageSelect(window, optsArgs).then(() => { | ||
if (nodes.length) startTranslationCycle(window, window.document.body, apiKey, debounceDuration) | ||
.catch(console.log) | ||
.finally(() => renderSelectorState(window)) | ||
if (nodes.length) startTranslationCycle(window, window.document.body, apiKey, debounceDuration).catch(console.log) | ||
}); | ||
} else { | ||
if (nodes.length) startTranslationCycle(window, window.document.body, apiKey, debounceDuration) | ||
.catch(console.log) | ||
.finally(() => renderSelectorState(window)) | ||
if (nodes.length) startTranslationCycle(window, window.document.body, apiKey, debounceDuration).catch(console.log) | ||
} | ||
@@ -113,0 +118,0 @@ }); |
{ | ||
"name": "globalseo", | ||
"version": "2.2.9", | ||
"version": "2.2.10", | ||
"description": "Translate your React.js or Next.js app with AI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -82,3 +82,4 @@ const { isCompressionSupported } = require("../compressions"); | ||
cleanTextNodes.forEach((node) => { | ||
const text = getCacheKey(window, node); | ||
const originalTextFromServer = node.parentNode.getAttribute("data-original-text"); | ||
const text = originalTextFromServer || getCacheKey(window, node); | ||
const tagName = getTagName(window, node); | ||
@@ -85,0 +86,0 @@ const context = node.context; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
566144
3510