mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
7c896ddb85
Ref #10119 Ref gh-1528 * Adds RequireJS and relies on AMD for loading dependencies. * Updates to grunt-contrib-qunit 0.6.0. * Convert `domEqual()` to a proper QUnit assertion. * Introduces two bootstrap files (JS and CSS) which use `data-` attributes to reduce the amount of boilerplate needed in each test
34 lines
600 B
JavaScript
34 lines
600 B
JavaScript
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;
|
|
|
|
});
|