mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-02-21 00:23:02 +08:00
Add class per plugin
This commit is contained in:
parent
1ee5c7dd2d
commit
824c3578d0
@ -63,6 +63,11 @@ class SimpleKeyboard {
|
||||
this.options.theme = this.options.theme || "hg-theme-default";
|
||||
this.options.inputName = this.options.inputName || "default";
|
||||
|
||||
/**
|
||||
* @type {object} Classes identifying loaded plugins
|
||||
*/
|
||||
this.keyboardPluginClasses = '';
|
||||
|
||||
/**
|
||||
* Bindings
|
||||
*/
|
||||
@ -557,11 +562,11 @@ class SimpleKeyboard {
|
||||
|
||||
/* istanbul ignore next */
|
||||
if(module.constructor.name && module.constructor.name !== "Function"){
|
||||
this.keyboardDOM.classList.add(
|
||||
`module-${this.utilities.camelCase(module.constructor.name)}`
|
||||
);
|
||||
let classStr = `module-${this.utilities.camelCase(module.constructor.name)}`;
|
||||
this.keyboardPluginClasses = this.keyboardPluginClasses + ` ${classStr}`;
|
||||
}
|
||||
|
||||
this.render();
|
||||
module.init(this);
|
||||
});
|
||||
}
|
||||
@ -633,7 +638,7 @@ class SimpleKeyboard {
|
||||
/**
|
||||
* Adding themeClass, layoutClass to keyboardDOM
|
||||
*/
|
||||
this.keyboardDOM.className += ` ${this.options.theme} ${layoutClass}`;
|
||||
this.keyboardDOM.className += ` ${this.options.theme} ${layoutClass} ${this.keyboardPluginClasses}`;
|
||||
|
||||
/**
|
||||
* Iterating through each row
|
||||
|
Loading…
Reference in New Issue
Block a user