Reuse abortAjax function on aspectNavigation widget

This commit is contained in:
Gonzalo Rodriguez 2011-09-11 22:49:40 -03:00
parent 37c67c23cf
commit 4f17dbf36e

View file

@ -47,6 +47,7 @@
if (self.aspectLis.not(".active").length === 0) { if (self.aspectLis.not(".active").length === 0) {
self.aspectLis.removeClass("active"); self.aspectLis.removeClass("active");
self.abortAjax(); self.abortAjax();
self.fadeIn();
} else { } else {
self.aspectLis.addClass("active"); self.aspectLis.addClass("active");
self.performAjax(); self.performAjax();
@ -101,12 +102,9 @@
history.pushState(null, document.title, newURL); history.pushState(null, document.title, newURL);
} }
if(self.jXHR) { self.abortAjax();
self.jXHR.abort();
self.jXHR = null;
}
self.fadeOut(); self.fadeOut();
self.jXHR = $.getScript(newURL, function(data) { self.jXHR = $.getScript(newURL, function(data) {
var textarea = $("#publisher textarea"), var textarea = $("#publisher textarea"),
photozone = $("#photodropzone"); photozone = $("#photodropzone");
@ -133,7 +131,6 @@
self.jXHR.abort(); self.jXHR.abort();
self.jXHR = null; self.jXHR = null;
} }
self.fadeIn();
}; };
this.fadeOut = function() { this.fadeOut = function() {