blob: 80cb27274fc85c16b7c9ce6f90a3a378ce472977 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
define([
"jquery"
], function( $ ) {
var exports = {};
exports.forceScrollableWindow = function( appendTo ) {
// The main testable area is 10000x10000 so to enforce scrolling,
// this DIV must be greater than 10000 to work
return $( "<div>" )
.css({
height: "11000px",
width: "11000px"
})
.appendTo( appendTo || "#qunit-fixture" );
};
exports.onFocus = function( element, onFocus ) {
var fn = function( event ) {
if ( !event.originalEvent ) {
return;
}
element.unbind( "focus", fn );
onFocus();
};
element.bind( "focus", fn )[ 0 ].focus();
};
return exports;
});
|