File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2600,16 +2600,16 @@ QUnit.test( "focusin on document & window", function( assert ) {
26002600 var counter = 0 ,
26012601 input = jQuery ( "<input />" ) ;
26022602
2603+ function increment ( ) {
2604+ counter ++ ;
2605+ }
2606+
26032607 input . appendTo ( "#qunit-fixture" ) ;
26042608
26052609 input [ 0 ] . focus ( ) ;
26062610
2607- jQuery ( window ) . on ( "focusout" , function ( ) {
2608- counter ++ ;
2609- } ) ;
2610- jQuery ( document ) . on ( "focusout" , function ( ) {
2611- counter ++ ;
2612- } ) ;
2611+ jQuery ( window ) . on ( "focusout" , increment ) ;
2612+ jQuery ( document ) . on ( "focusout" , increment ) ;
26132613
26142614 input [ 0 ] . blur ( ) ;
26152615
@@ -2620,6 +2620,9 @@ QUnit.test( "focusin on document & window", function( assert ) {
26202620
26212621 assert . strictEqual ( counter , 2 ,
26222622 "focusout handlers on document/window fired once only" ) ;
2623+
2624+ jQuery ( window ) . off ( "focusout" , increment ) ;
2625+ jQuery ( document ) . off ( "focusout" , increment ) ;
26232626} ) ;
26242627
26252628testIframe (
You can’t perform that action at this time.
0 commit comments