Permalink
Browse files

[loader] Wrap functions bound to events in $.proxy at binding time, a…

…nd pass then unwrapped at unbinding time
  • Loading branch information...
1 parent 4926901 commit ad9adc31443aba4e47323c190f697a3c0aaae2d5 @gabrielschulhof gabrielschulhof committed Oct 4, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 js/widgets/loader.js
View
@@ -85,7 +85,7 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
this.fakeFixLoader();
$window
.unbind( "scroll", this.checkLoaderPosition )
- .bind( "scroll", this.fakeFixLoader );
+ .bind( "scroll", $.proxy( this.fakeFixLoader, this ) );
}
},
@@ -170,8 +170,8 @@ define( [ "jquery", "../jquery.mobile.core", "../jquery.mobile.widget" ], functi
this.element.removeClass( "ui-loader-fakefix" );
}
- $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
- $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+ $( window ).unbind( "scroll", this.fakeFixLoader );
+ $( window ).unbind( "scroll", this.checkLoaderPosition );
}
});

0 comments on commit ad9adc3

Please sign in to comment.