diff --git a/src/kioskboard.js b/src/kioskboard.js index a008a08..d9f9270 100644 --- a/src/kioskboard.js +++ b/src/kioskboard.js @@ -65,6 +65,8 @@ keysFontSize: '22px', keysFontWeight: 'normal', keysIconSize: '25px', + keysCallback: undefined, + keysBackspaceCallback: undefined, keysEnterText: 'Enter', keysEnterCallback: undefined, keysEnterCanClose: true, @@ -72,6 +74,7 @@ var kioskBoardCachedKeys; var kioskBoardNewOptions; var kioskBoardGithubUrl = 'https://github.com/furcan/KioskBoard'; + var kioskBoardElementsWithFocusListener = {}; var kioskBoardSpecialCharacters = { '0': '!', '1': '\'', @@ -442,7 +445,7 @@ if (keyboardType === kioskBoardTypes.Numpad) { // check "keysNumpadArrayOfNumbers" for override: begin var numpadKeys = opt.keysNumpadArrayOfNumbers; - if (Array.isArray(numpadKeys) && numpadKeys.length === 10) { + if (Array.isArray(numpadKeys) && numpadKeys.length === 11) { // length is the number of numbers + 1 decimal separator char (',' or '.') kioskBoardNumpadKeysObject = numpadKeys.reduce(function (numpadMemo, numpadKey, numpadIndex) { numpadMemo[numpadIndex] = numpadKey; return numpadMemo; @@ -451,15 +454,21 @@ // check "keysNumpadArrayOfNumbers" for override: end var numpadKeysContent = ''; + var decimalSeparatorKey = ''; for (var key3 in kioskBoardNumpadKeysObject) { if (Object.prototype.hasOwnProperty.call(kioskBoardNumpadKeysObject, key3)) { var index3 = key3; var value3 = kioskBoardNumpadKeysObject[key3]; - var eachKey3 = '' + value3.toString() + ''; - numpadKeysContent += eachKey3; + if (!isNaN(parseInt(value3))) { // only the numbers + var eachKey3 = '' + value3.toString() + ''; + numpadKeysContent += eachKey3; + } + if (value3 == ',' || value3 == '.') { // decimal separator + decimalSeparatorKey = '' + value3.toString() + ''; + } } } - keysRowElements += '