Fix flicker portal in portal render limit handler

Change:
Extract portal handle process from "handleDataResponse" to "handlePortalData"
Add "action" property to object returned by $.ajax() to identity type of request
Delay low level portal render until no active request of map data.
This commit is contained in:
Xelio
2013-02-28 14:40:35 +08:00
parent 49dafaa3d4
commit c75caa91dd
3 changed files with 113 additions and 17 deletions

View File

@ -58,7 +58,7 @@ window.postAjax = function(action, data, success, error) {
data = JSON.stringify($.extend({method: 'dashboard.'+action}, data));
var remove = function(data, textStatus, jqXHR) { window.requests.remove(jqXHR); };
var errCnt = function(jqXHR) { window.failedRequestCount++; window.requests.remove(jqXHR); };
return $.ajax({
var result = $.ajax({
// use full URL to avoid issues depending on how people set their
// slash. See:
// https://github.com/breunigs/ingress-intel-total-conversion/issues/56
@ -73,6 +73,8 @@ window.postAjax = function(action, data, success, error) {
req.setRequestHeader('X-CSRFToken', readCookie('csrftoken'));
}
});
result.action = action;
return result;
}
// converts unix timestamps to HH:mm:ss format if it was today;