Skip to content

Commit 2787e74

Browse files
committed
build
1 parent 8ee8f88 commit 2787e74

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

dist/leaflet.ajax.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,7 @@ var L = global.L || require('leaflet');
523523
var Promise = require('lie');
524524

525525
module.exports = function(url, options) {
526-
if (!global._leafletJSONPcallbacks) {
527-
global._leafletJSONPcallbacks = {};
528-
}
526+
529527
options = options || {};
530528
var head = document.getElementsByTagName('head')[0];
531529
var scriptNode = L.DomUtil.create('script', '', head);
@@ -541,10 +539,17 @@ module.exports = function(url, options) {
541539
}
542540
scriptNode.type = 'text/javascript';
543541
if (cbSuffix) {
542+
if (!global._leafletJSONPcallbacks) {
543+
global._leafletJSONPcallbacks = {
544+
length: 0
545+
};
546+
}
547+
global._leafletJSONPcallbacks.length++;
544548
global._leafletJSONPcallbacks[cbSuffix] = function(data) {
545549
head.removeChild(scriptNode);
546550
delete global._leafletJSONPcallbacks[cbSuffix];
547-
if (!Object.keys(global._leafletJSONPcallbacks).length) {
551+
global._leafletJSONPcallbacks.length--;
552+
if (!global._leafletJSONPcallbacks.length) {
548553
delete global._leafletJSONPcallbacks;
549554
}
550555
resolve(data);

dist/leaflet.ajax.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)