Show and hide loading screen

The Visto framework provides the ability to show a fullscreen loading screen. This loading screen can also be used by the user of the framework during operations which take a long time.

The loading screen can be shown like this:

require(visto, function() {
	visto.showLoading();
	setTimeout(function() {
		visto.hideLoading();
	}, 10000);
}

Change the look of the loading screen

It is possible to change the look of the loading screen. This can be done by replacing the createLoadingElement method of the Visto object. Simply replace the method in the app.js file before calling navigateTo or restorePages.

The default implementation:

visto.createLoadingElement = function () {
	var element = $(document.createElement("div"));
	element.addClass("ui-widget-overlay ui-front");
	element.html("<div style='text-align: center; color: white'>" +
		"<img src='images/loading.gif' style='border: 0; margin-top: 150px' /></div>");
	return element;
};


Last edited Nov 23, 2013 at 9:46 PM by rsuter, version 5

Comments

No comments yet.