mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-05-19 00:00:07 +08:00
Update types, tests
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
let stdBtnCount = 0;
|
||||
let fullInput = '';
|
||||
|
||||
iterateButtons((button) => {
|
||||
keyboard.recurseButtons((button) => {
|
||||
const label = button.getAttribute("data-skbtn");
|
||||
|
||||
if(label.includes("{"))
|
||||
@@ -89,11 +89,11 @@
|
||||
/**
|
||||
* Test if function buttons are interactive (have an onclick)
|
||||
*/
|
||||
export const testLayoutFctButtons = (callback) => {
|
||||
export const testLayoutFctButtons = (keyboard, callback) => {
|
||||
let fctBtnCount = 0;
|
||||
let fctBtnHasOnclickCount = 0;
|
||||
|
||||
iterateButtons((button) => {
|
||||
keyboard.recurseButtons((button) => {
|
||||
const label = button.getAttribute("data-skbtn");
|
||||
|
||||
if(!label.includes("{") && !label.includes("}"))
|
||||
@@ -110,19 +110,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterates on the keyboard buttons
|
||||
*/
|
||||
export const iterateButtons = (callback, selector) => {
|
||||
const rows = document.body.querySelector(selector || '.simple-keyboard').children;
|
||||
|
||||
Array.from(rows).forEach(row => {
|
||||
Array.from(row.children).forEach((button) => {
|
||||
callback(button);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove RTL control chars
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user