Added loaded flag to prevent multiple calls to onLoad method

This commit is contained in:
Pavle Goloskokovic 2018-01-21 15:12:34 +01:00
parent e1c5969bd4
commit d743ac82c1

View file

@ -15,6 +15,8 @@ var HTML5AudioFile = new Class({
{
this.locked = locked;
this.loaded = false;
var fileConfig = {
type: 'audio',
extension: GetFastValue(url, 'type', ''),
@ -29,6 +31,13 @@ var HTML5AudioFile = new Class({
onLoad: function ()
{
if(this.loaded)
{
return;
}
this.loaded = true;
this.loader.nextFile(this, true);
},