Cross Reference: window-focus.js
xref
: /
yui3
/
src
/
event
/
tests
/
window-focus.js
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
window-focus.js revision 288cb1eb48cf1e1756380d500de92f74ac32ec60
YUI
.
add
(
'window-focus'
,
function
(Y) {
Y.
isWindowInFocus
=
function
() {
var
ret
=
false
,
doc
= Y.
config
.
doc
,
input
=
doc
.
createElement
(
'input'
);
input
.
onfocus
=
input
.
onfocusout
=
function
() {
ret
=
true
;
};
doc
.
body
.
insertBefore
(
input
,
doc
.
body
.
firstChild
);
input
.
focus
();
input
.
blur
();
doc
.
body
.
removeChild
(
input
);
input
.
onfocus
=
input
.
onfocusout
=
null
;
return
ret
;
}
});