Code restructure 3
This commit is contained in:
@ -82,20 +82,13 @@ window.portalRenderLimit.splitOrMergeLowLevelPortals = function(originPortals) {
|
||||
portalRenderLimit.resetCounting();
|
||||
portalRenderLimit.countingPortals(originPortals);
|
||||
|
||||
var resultPortals = portalRenderLimit.isLastRequest()
|
||||
var resultPortals = requests.isLastRequest('getThinnedEntitiesV2')
|
||||
? portalRenderLimit.mergeLowLevelPortals(originPortals)
|
||||
: portalRenderLimit.splitLowLevelPortals(originPortals);
|
||||
|
||||
return resultPortals;
|
||||
}
|
||||
|
||||
window.portalRenderLimit.handleFailRequest = function() {
|
||||
if(portalRenderLimit.isLastRequest()) {
|
||||
var resultPortals = portalRenderLimit.mergeLowLevelPortals(null);
|
||||
handlePortalsRender(resultPortals);
|
||||
}
|
||||
}
|
||||
|
||||
window.portalRenderLimit.countingPortals = function(portals) {
|
||||
$.each(portals, function(ind, portal) {
|
||||
var portalGuid = portal[0];
|
||||
@ -134,17 +127,6 @@ window.portalRenderLimit.mergeLowLevelPortals = function(appendTo) {
|
||||
return resultPortals;
|
||||
}
|
||||
|
||||
window.portalRenderLimit.isLastRequest = function() {
|
||||
var result = true;
|
||||
$.each(window.activeRequests, function(ind, req) {
|
||||
if(req.action === 'getThinnedEntitiesV2') {
|
||||
result = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
window.portalRenderLimit.getMinLevel = function() {
|
||||
if(!portalRenderLimit.initialized) return -1;
|
||||
if(!portalRenderLimit.minLevelSet) portalRenderLimit.setMinLevel();
|
||||
|
Reference in New Issue
Block a user