calling it ajaxify.preloader instead

v1.18.x
psychobunny 11 years ago
parent eb69d898ce
commit 7f011fe583

@ -21,7 +21,7 @@ var ajaxify = ajaxify || {};
ajaxify.currentPage = null; ajaxify.currentPage = null;
ajaxify.initialLoad = false; ajaxify.initialLoad = false;
ajaxify.preloaded = null; ajaxify.preloader = null;
function onAjaxError(err) { function onAjaxError(err) {
var data = err.data, textStatus = err.textStatus; var data = err.data, textStatus = err.textStatus;
@ -185,8 +185,8 @@ var ajaxify = ajaxify || {};
}; };
ajaxify.loadData = function(callback, url, template) { ajaxify.loadData = function(callback, url, template) {
if (ajaxify.preloaded && ajaxify.preloaded.url === url) { if (ajaxify.preloader && ajaxify.preloader.url === url) {
return callback(null, ajaxify.preloaded.data); return callback(null, ajaxify.preloader.data);
} }
$(window).trigger('action:ajaxify.loadingData', {url: url}); $(window).trigger('action:ajaxify.loadingData', {url: url});
@ -299,7 +299,7 @@ var ajaxify = ajaxify || {};
// Internal link // Internal link
var url = this.href.replace(rootUrl + '/', ''); var url = this.href.replace(rootUrl + '/', '');
ajaxify.loadData(function(err, data) { ajaxify.loadData(function(err, data) {
ajaxify.preloaded = { ajaxify.preloader = {
url: url, url: url,
data: data data: data
}; };
@ -310,7 +310,7 @@ var ajaxify = ajaxify || {};
$(document.body).on('mouseout', 'a', function (e) { $(document.body).on('mouseout', 'a', function (e) {
setTimeout(function() { setTimeout(function() {
ajaxify.preloaded = null; ajaxify.preloader = null;
}, 500); }, 500);
}); });

Loading…
Cancel
Save