1
0
Fork 0
forked from 0x2620/oxjs

add bindKeyboard and unbindKeyboard methods to Ox.Element, allowing an element to receive all keyboard events, independently of focus

This commit is contained in:
rlx 2011-11-01 11:49:46 +00:00
commit 3aa10edec8
2 changed files with 30 additions and 38 deletions

View file

@ -301,6 +301,11 @@ Ox.Element = function(options, self) {
return that;
};
that.bindKeyboard = function() {
Ox.Keyboard.bind(that.id);
return that;
};
/*@
defaults <function> Sets the default options for an element object
({key: value, ...}) -> <obj> This element object
@ -335,7 +340,6 @@ Ox.Element = function(options, self) {
loseFocus <function> Makes an element object lose focus
() -> <object> This element object
@*/
that.loseFocus = function() {
Ox.Focus.blur(that.id);
return that;
@ -428,6 +432,11 @@ Ox.Element = function(options, self) {
return that;
};
that.unbindKeyboard = function() {
Ox.Keyboard.unbind(that.id);
return that;
};
return that;
};