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:
parent
b6a8ed28b4
commit
3aa10edec8
2 changed files with 30 additions and 38 deletions
|
|
@ -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;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue