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 ) {
2600
2600
var counter = 0 ,
2601
2601
input = jQuery ( "<input />" ) ;
2602
2602
2603
+ function increment ( ) {
2604
+ counter ++ ;
2605
+ }
2606
+
2603
2607
input . appendTo ( "#qunit-fixture" ) ;
2604
2608
2605
2609
input [ 0 ] . focus ( ) ;
2606
2610
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 ) ;
2613
2613
2614
2614
input [ 0 ] . blur ( ) ;
2615
2615
@@ -2620,6 +2620,9 @@ QUnit.test( "focusin on document & window", function( assert ) {
2620
2620
2621
2621
assert . strictEqual ( counter , 2 ,
2622
2622
"focusout handlers on document/window fired once only" ) ;
2623
+
2624
+ jQuery ( window ) . off ( "focusout" , increment ) ;
2625
+ jQuery ( document ) . off ( "focusout" , increment ) ;
2623
2626
} ) ;
2624
2627
2625
2628
testIframe (
You can’t perform that action at this time.
0 commit comments