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

Commit

Permalink
Loader: Attach to body when no $.mobile.pageContainer found
Browse files Browse the repository at this point in the history
Fixes gh-7760
  • Loading branch information
Gabriel Schulhof committed Oct 9, 2014
1 parent f02420e commit 18b6e41
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions js/widgets/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
//>>label: Loading Message
//>>group: Widgets

define( [ "jquery", "../core", "../widget" ], function( jQuery ) {
define( [
"jquery",
"../helpers",
"../defaults",
"../widget" ], function( jQuery ) {
//>>excludeEnd("jqmBuildExclude");

(function( $ ) {
Expand Down Expand Up @@ -115,7 +119,9 @@ define( [ "jquery", "../core", "../widget" ], function( jQuery ) {
}

// attach the loader to the DOM
this.element.appendTo( $.mobile.pageContainer );
this.element.appendTo(
( $.mobile.pageContainer && $.mobile.pageContainer.length > 0 ) ?
$.mobile.pageContainer : $( "body" ) );

// check that the loader is visible
this.checkLoaderPosition();
Expand All @@ -131,8 +137,8 @@ define( [ "jquery", "../core", "../widget" ], function( jQuery ) {
this.element.removeClass( "ui-loader-fakefix" );
}

$.mobile.window.unbind( "scroll", this.fakeFixLoader );
$.mobile.window.unbind( "scroll", this.checkLoaderPosition );
this.window.unbind( "scroll", this.fakeFixLoader );
this.window.unbind( "scroll", this.checkLoaderPosition );
}
});

Expand Down

0 comments on commit 18b6e41

Please sign in to comment.