Skip to content

Commit

Permalink
fix: configTimeout not being honored (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
techfg committed Apr 10, 2024
1 parent f8d6971 commit f0a2035
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/mapimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

var m = $.mapster,
u = m.utils,
ap = [];
ap = [],
configCheckInterval = 50;
/**
* An object encapsulating all the images used by a MapData.
*/
Expand Down Expand Up @@ -167,7 +168,7 @@
bind: function () {
var me = this,
promise,
triesLeft = me.owner.options.configTimeout / 200,
triesLeft = me.owner.options.configTimeout / configCheckInterval,
/* A recursive function to continue checking that the images have been
loaded until a timeout has elapsed */

Expand All @@ -193,7 +194,7 @@
if (triesLeft-- > 0) {
me.imgTimeout = window.setTimeout(function () {
check.call(me, true);
}, 50);
}, configCheckInterval);
} else {
me.imageLoadError.call(me);
}
Expand Down

0 comments on commit f0a2035

Please sign in to comment.