corrade-http-templates – Blame information for rev 57
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
57 | office | 1 | define( [ |
2 | "jquery" |
||
3 | ], function( $ ) { |
||
4 | |||
5 | var exports = {}; |
||
6 | |||
7 | exports.forceScrollableWindow = function( appendTo ) { |
||
8 | |||
9 | // The main testable area is 10000x10000 so to enforce scrolling, |
||
10 | // this DIV must be greater than 10000 to work |
||
11 | return $( "<div>" ) |
||
12 | .css( { |
||
13 | height: "11000px", |
||
14 | width: "11000px" |
||
15 | } ) |
||
16 | .appendTo( appendTo || "#qunit-fixture" ); |
||
17 | }; |
||
18 | |||
19 | exports.onFocus = function( element, onFocus ) { |
||
20 | var fn = function( event ) { |
||
21 | if ( !event.originalEvent ) { |
||
22 | return; |
||
23 | } |
||
24 | element.off( "focus", fn ); |
||
25 | onFocus(); |
||
26 | }; |
||
27 | |||
28 | element.on( "focus", fn )[ 0 ].focus(); |
||
29 | }; |
||
30 | |||
31 | return exports; |
||
32 | |||
33 | } ); |