mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-02-22 01:29:39 +08:00
onRender functionality
This commit is contained in:
parent
a321ab9b91
commit
c980024e71
@ -237,6 +237,11 @@ class SimpleKeyboard {
|
|||||||
this.options.onInit();
|
this.options.onInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onRender = () => {
|
||||||
|
if(typeof this.options.onRender === "function")
|
||||||
|
this.options.onRender();
|
||||||
|
}
|
||||||
|
|
||||||
render = () => {
|
render = () => {
|
||||||
/**
|
/**
|
||||||
* Clear keyboard
|
* Clear keyboard
|
||||||
@ -331,6 +336,20 @@ class SimpleKeyboard {
|
|||||||
*/
|
*/
|
||||||
this.keyboardDOM.appendChild(rowDOM);
|
this.keyboardDOM.appendChild(rowDOM);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calling onRender
|
||||||
|
*/
|
||||||
|
this.onRender();
|
||||||
|
|
||||||
|
if(!this.initialized){
|
||||||
|
this.initialized = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calling onInit
|
||||||
|
*/
|
||||||
|
this.onInit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user