electron-virtual-keyboard
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "electron-virtual-keyboard", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An electron based virtual keyboard. Uses electron's sendInputEvent api to implement a simple customizable soft keyboard.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -354,11 +354,16 @@ (function (factory) { | ||
if ( this.config.autoPosition ) { | ||
if ( this.config.autoPosition && typeof this.config.autoPosition != 'function' ) { | ||
var offset = $('body').offset(); | ||
// figure out bottom center position of the element | ||
var position = el.getBoundingClientRect(); | ||
} | ||
var bounds = el.getBoundingClientRect(); | ||
var position = { | ||
x: bounds.left + offset.left, | ||
y: bounds.top + offset.top, | ||
width: bounds.width, | ||
height: bounds.height | ||
} | ||
if ( this.config.autoPosition ) { | ||
var x = position.x + ((position.width - this.$container.width()) / 2); | ||
var x = position.x + ((position.width - this.$container.width()) / 2);`` | ||
// keep container away from spilling outside window width | ||
if ((x + this.$container.width()) > $(window).width) { | ||
if ((x + this.$container.width()) > $(window).width()) { | ||
x = $(window).width() - this.$container.width(); | ||
@@ -374,3 +379,3 @@ } | ||
left: x | ||
}) | ||
}); | ||
} | ||
@@ -377,0 +382,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
517390
886