You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solved it with the help of an "keysEnterCallback"
////////////////////////////////////////////////////////////////////////
//START switch Language по event kioskboard-key-enter
////////////////////////////////////////////////////////////////////////
var k = a.document.querySelector(".kioskboard-key-enter");
k && va(k, function (a) {
//switchLanguage()//
a.preventDefault(), b.focus()
!0 === A.keysEnterCanClose && ta(), "function" == typeof A.keysEnterCallback && A.keysEnterCallback();
var language
if (k.textContent == 'RU') { k.innerHTML = "EN"; language = russianKeyboard } else { k.innerHTML = "RU"; language = englishKeyboard }
var row_dynamic = document.getElementsByClassName('kioskboard-row-dynamic')
// dynamic keys group: begin
for (var i = 0; i < language.length; i++) {
var eachObj = language[i];
var rowKeysContent = '';
for (var key5 in eachObj) {
if (Object.prototype.hasOwnProperty.call(eachObj, key5)) {
var index5 = key5;
var value5 = eachObj[key5];
var eachKey5 = '' + value5.toString() + '';
rowKeysContent += eachKey5;
}}
// add current row
row_dynamic[i].innerHTML = rowKeysContent
}
// update listener (key's)
const keys = document.querySelectorAll('.kioskboard-key');
function spansClick(a) {
a.preventDefault();
var c = 1 * (b.getAttribute("maxlength") || ""),
d = 1 * (b.getAttribute("max") || ""),
e = (b.value || "").length || 0;
if (0 < c && e >= c) return !1;
if (0 < d && e >= d) return !1;
b.focus();
var f = a.currentTarget.dataset.value || "";
f = G ? f.toLocaleUpperCase(z) : f.toLocaleLowerCase(z);
for (var g = f.split(""), h = 0; h < g.length; h++) m = b.selectionStart || (b.value || "").length, n.splice(m, 0, g[h]), b.value = n.join(""), "number" !== b.type && b.setSelectionRange(m + 1, m + 1), b.dispatchEvent(ua)
}
// addEventListener --> click (key)
keys.forEach((span) => {
span.addEventListener('click', spansClick);
});
})
////////////////////////////////////////////////////////////////////////
//END switch Language по event kioskboard-key-enter
////////////////////////////////////////////////////////////////////////
Hi. Is there a solution to switch languages within a single keyboard object?
Have a nice day!
The text was updated successfully, but these errors were encountered: