this._url keep an url after _initImage

updated ImageOverlay and VideoOverlay
This commit is contained in:
Unknown 2017-12-05 20:51:34 +02:00
parent 39c3bf7ed3
commit 575ced6e2c
2 changed files with 8 additions and 2 deletions

View File

@ -202,7 +202,10 @@ export var ImageOverlay = Layer.extend({
this._updateZIndex();
}
if (wasElementSupplied) { return; }
if (wasElementSupplied) {
this._url = img.src;
return;
}
img.src = this._url;
img.alt = this.options.alt;

View File

@ -49,7 +49,10 @@ export var VideoOverlay = ImageOverlay.extend({
// Fired when the video has finished loading the first frame
vid.onloadeddata = Util.bind(this.fire, this, 'load');
if (wasElementSupplied) { return; }
if (wasElementSupplied) {
this._url = vid.src;
return;
}
if (!Util.isArray(this._url)) { this._url = [this._url]; }