Skip to content

Commit

Permalink
feat(custom-class): add support to custom-class configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
the-darc committed Nov 19, 2015
1 parent ff69a73 commit b2477cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/angular-virtual-keyboard.js
Expand Up @@ -61,7 +61,8 @@ angular.module('angular-virtual-keyboard', [])
'11': 'Increase keyboard size'
},
relative: true,
sizeAdj: true
sizeAdj: true,
customClass: false
})
.service('ngVirtualKeyboardService', ['VKI_CONFIG', function(VKI_CONFIG) {
/*globals VKI */
Expand All @@ -73,6 +74,7 @@ angular.module('angular-virtual-keyboard', [])
config.relative = config.relative === false ? false : VKI_CONFIG.relative;
config.keyCenter = config.keyCenter || VKI_CONFIG.keyCenter;
config.sizeAdj = config.sizeAdj === false ? false : VKI_CONFIG.sizeAdj;
config.customClass = config.customClass || VKI_CONFIG.customClass;

var vki = new VKI(config, VKI_CONFIG.layout, VKI_CONFIG.deadkey, inputCallback);
vki.attachVki(element);
Expand Down
4 changes: 4 additions & 0 deletions src/vki-core.js
Expand Up @@ -77,6 +77,7 @@ var VKI = function(customConfig, layout, deadKeys, keyInputCallback) {
this.VKI_keyCenter = config.keyCenter || 3;
this.VKI_forcePosition = config.forcePosition || false;
this.VKI_relative = config.relative === false ? false : true;
this.VKI_customClass = config.customClass || false;

this.VKI_isIE = /*@cc_on!@*/false;
this.VKI_isIE6 = /*@if(@_jscript_version == 5.6)!@end@*/false;
Expand Down Expand Up @@ -279,6 +280,9 @@ var VKI = function(customConfig, layout, deadKeys, keyInputCallback) {
if (this.VKI_relative) {
self.VKI_keyboard.className += ' relativeKeyboard';
}
if (this.VKI_customClass) {
self.VKI_keyboard.className += ' ' + this.VKI_customClass;
}
this.VKI_keyboard.dir = "ltr";
this.VKI_keyboard.cellSpacing = "0";
this.VKI_keyboard.reflow = function() {
Expand Down

0 comments on commit b2477cd

Please sign in to comment.