@ -171,7 +171,8 @@ function Network (container, data, options) {
} ,
keyboard : {
enabled : false ,
speed : { x : 10 , y : 10 , zoom : 0.02 }
speed : { x : 10 , y : 10 , zoom : 0.02 } ,
bindToWindow : true
} ,
dataManipulation : {
enabled : false ,
@ -756,6 +757,7 @@ Network.prototype._create = function () {
this . frame . className = 'vis network-frame' ;
this . frame . style . position = 'relative' ;
this . frame . style . overflow = 'hidden' ;
this . frame . tabIndex = 900 ;
//////////////////////////////////////////////////////////////////
@ -835,7 +837,13 @@ Network.prototype._createKeyBinds = function() {
if ( this . keycharm !== undefined ) {
this . keycharm . destroy ( ) ;
}
this . keycharm = keycharm ( ) ;
if ( this . constants . keyboard . bindToWindow == true ) {
this . keycharm = keycharm ( { container : window , preventDefault : false } ) ;
}
else {
this . keycharm = keycharm ( { container : this . frame , preventDefault : false } ) ;
}
this . keycharm . reset ( ) ;
@ -1280,6 +1288,11 @@ Network.prototype._onMouseMoveTitle = function (event) {
this . _checkHidePopup ( pointer ) ;
}
// if we bind the keyboard to the div, we have to highlight it to use it. This highlights it on mouse over
if ( this . constants . keyboard . bindToWindow == false && this . constants . keyboard . enabled == true ) {
this . frame . focus ( ) ;
}
// start a timeout that will check if the mouse is positioned above
// an element
var me = this ;