mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-11 00:02:15 +08:00
Docs update
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user