From c980024e71e7b24a34836c0ef78f3448da9ce57a Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Sat, 6 Oct 2018 02:24:04 -0400 Subject: [PATCH] onRender functionality --- src/lib/components/Keyboard.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lib/components/Keyboard.js b/src/lib/components/Keyboard.js index 555e54ba..0a9da1f8 100644 --- a/src/lib/components/Keyboard.js +++ b/src/lib/components/Keyboard.js @@ -237,6 +237,11 @@ class SimpleKeyboard { this.options.onInit(); } + onRender = () => { + if(typeof this.options.onRender === "function") + this.options.onRender(); + } + render = () => { /** * Clear keyboard @@ -331,6 +336,20 @@ class SimpleKeyboard { */ this.keyboardDOM.appendChild(rowDOM); }); + + /** + * Calling onRender + */ + this.onRender(); + + if(!this.initialized){ + this.initialized = true; + + /** + * Calling onInit + */ + this.onInit(); + } } }