Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit ad9adc3

Browse files
author
Gabriel Schulhof
committed
[loader] Wrap functions bound to events in $.proxy at binding time, and pass then unwrapped at unbinding time
1 parent 4926901 commit ad9adc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/widgets/loader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
8585
this.fakeFixLoader();
8686
$window
8787
.unbind( "scroll", this.checkLoaderPosition )
88-
.bind( "scroll", this.fakeFixLoader );
88+
.bind( "scroll", $.proxy( this.fakeFixLoader, this ) );
8989
}
9090
},
9191

@@ -170,8 +170,8 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
170170
this.element.removeClass( "ui-loader-fakefix" );
171171
}
172172

173-
$( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
174-
$( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
173+
$( window ).unbind( "scroll", this.fakeFixLoader );
174+
$( window ).unbind( "scroll", this.checkLoaderPosition );
175175
}
176176
});
177177

0 commit comments

Comments
 (0)