js/loader: stop pending subcontainer requests

When redrawing a container we should cancel it's subcontainers pending
requests. This also fixes stopPendingRequestsFor(), it didn't really
work before.
This commit is contained in:
Thomas Gelf 2014-06-24 07:01:37 +02:00
parent 90bb20f4c3
commit 0604d30348
1 changed files with 6 additions and 2 deletions

View File

@ -141,11 +141,11 @@
stopPendingRequestsFor: function ($el) {
var id;
if (typeof $el !== 'undefined' || ! (id = $el.attr('id'))) {
if (typeof $el === 'undefined' || ! (id = $el.attr('id'))) {
return;
}
if (id in this.requests) {
if (typeof this.requests[id] !== 'undefined') {
this.requests[id].abort();
}
},
@ -623,6 +623,7 @@
renderContentToContainer: function (content, $container, action, autorefresh) {
// Container update happens here
var scrollPos = false;
var self = this;
var containerId = $container.attr('id');
if (typeof containerId !== 'undefined') {
scrollPos = $container.scrollTop();
@ -644,6 +645,9 @@
event.preventDefault();
});
$('.container', $container).each(function() {
self.stopPendingRequestsFor($(this));
});
if (false &&
$('.dashboard', $content).length > 0 &&