checks itemstoload to be equal or lower than zero, just in case
This commit is contained in:
parent
9b421d7d7f
commit
395edc39e0
@ -140,7 +140,7 @@ var filters = require('./torque_filters');
|
|||||||
return a.href;
|
return a.href;
|
||||||
};
|
};
|
||||||
var img_name = qualifyURL(st["marker-file"] || st["point-file"]);
|
var img_name = qualifyURL(st["marker-file"] || st["point-file"]);
|
||||||
if (img_name && this._icons.itemsToLoad === 0) {
|
if (img_name && this._icons.itemsToLoad <= 0) {
|
||||||
var img = this._icons[img_name];
|
var img = this._icons[img_name];
|
||||||
img.w = st['marker-width'] || img.width;
|
img.w = st['marker-width'] || img.width;
|
||||||
img.h = st['marker-width'] || st['marker-height'];
|
img.h = st['marker-width'] || st['marker-height'];
|
||||||
@ -328,7 +328,7 @@ var filters = require('./torque_filters');
|
|||||||
self._icons[this.src] = this;
|
self._icons[this.src] = this;
|
||||||
if (Object.keys(self._icons).length === img_names.length + 1){
|
if (Object.keys(self._icons).length === img_names.length + 1){
|
||||||
self._icons.itemsToLoad--;
|
self._icons.itemsToLoad--;
|
||||||
if (self._icons.itemsToLoad === 0){
|
if (self._icons.itemsToLoad <= 0){
|
||||||
self.clearSpriteCache();
|
self.clearSpriteCache();
|
||||||
self.fire("allIconsLoaded");
|
self.fire("allIconsLoaded");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user