Docs update

This commit is contained in:
Francisco Hodge
2018-11-01 00:14:02 -04:00
parent b7636841f7
commit 40e50108ae
7 changed files with 37289 additions and 34168 deletions
+14 -1
View File
@@ -133,6 +133,7 @@ class SimpleKeyboard {
this.handleButtonMouseUp = this.handleButtonMouseUp.bind(this);
this.handleButtonMouseDown = this.handleButtonMouseDown.bind(this);
this.handleButtonHold = this.handleButtonHold.bind(this);
this.onModulesLoaded = this.onModulesLoaded.bind(this);
/**
* simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).
@@ -584,6 +585,14 @@ class SimpleKeyboard {
this.options.onRender();
}
/**
* Executes the callback function once all modules have been loaded
*/
onModulesLoaded(){
if(typeof this.options.onModulesLoaded === "function")
this.options.onModulesLoaded();
}
/**
* Register module
*/
@@ -608,9 +617,13 @@ class SimpleKeyboard {
this.keyboardPluginClasses = this.keyboardPluginClasses + ` ${classStr}`;
}
this.render();
module.init(this);
});
this.keyboardPluginClasses = this.keyboardPluginClasses + ' modules-loaded';
this.render();
this.onModulesLoaded();
}
}