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

Commit

Permalink
[loader] Wrap functions bound to events in $.proxy at binding time, a…
Browse files Browse the repository at this point in the history
…nd pass then unwrapped at unbinding time
  • Loading branch information
Gabriel Schulhof committed Oct 4, 2012
1 parent 4926901 commit ad9adc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/widgets/loader.js
Expand Up @@ -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 ) );
}
},

Expand Down Expand Up @@ -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 );
}
});

Expand Down

0 comments on commit ad9adc3

Please sign in to comment.