Rename onceDatalayersDataLoaded to onceDataLoaded

This commit is contained in:
Yohan Boniface 2020-03-22 14:38:45 +01:00
parent ccf2c1b4fe
commit c18dd863ce
2 changed files with 7 additions and 7 deletions

View file

@ -209,7 +209,7 @@ L.U.Map.include({
if (this.options.onLoadPanel === 'databrowser') this.openBrowser();
else if (this.options.onLoadPanel === 'caption') this.displayCaption();
});
this.onceDatalayersDataLoaded(function () {
this.onceDataLoaded(function () {
const slug = L.Util.queryString('feature');
if (slug && this.features_index[slug]) this.features_index[slug].view();
});
@ -309,8 +309,8 @@ L.U.Map.include({
if (toload === 0) loaded();
};
var dataLoaded = function () {
self.datalayersDataLoaded = true;
self.fire('datalayersdataloaded');
self.dataLoaded = true;
self.fire('dataloaded');
};
var decrementDataToLoad = function () {
dataToload--;
@ -354,12 +354,12 @@ L.U.Map.include({
return this;
},
onceDatalayersDataLoaded: function (callback, context) {
onceDataLoaded: function (callback, context) {
// Once datalayers **data** have been loaded
if (this.datalayersDataLoaded) {
if (this.dataLoaded) {
callback.call(context || this, this);
} else {
this.once('datalayersdataloaded', callback, context);
this.once('dataloaded', callback, context);
}
return this;
},

View file

@ -46,7 +46,7 @@ L.U.Slideshow = L.Class.extend({
// Certainly IE8, which has a limited version of defineProperty
}
if (this.options.autoplay) {
this.map.onceDatalayersDataLoaded(function () {
this.map.onceDataLoaded(function () {
this.play();
}, this);
}