mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
bugfix
This commit is contained in:
1 parent
a26afec5ac
commit
59581f9e97
6 files changed
+5
-80
No files matched your search
+2
-33
@@ -1054,7 +1054,6 @@
|
||||
|
||||
this.art = art;
|
||||
this.option = option;
|
||||
this.isLoad = false;
|
||||
this.init();
|
||||
}
|
||||
|
||||
@@ -1067,44 +1066,14 @@
|
||||
$progress = _this$art.refs.$progress,
|
||||
proxy = _this$art.events.proxy;
|
||||
proxy($progress, 'mousemove', function (event) {
|
||||
_this.checkLoad(_this.art.option.thumbnails.url).then(function () {
|
||||
_this.option.ref.style.display = 'block';
|
||||
_this.option.ref.style.display = 'block';
|
||||
|
||||
_this.showThumbnails(event);
|
||||
});
|
||||
_this.showThumbnails(event);
|
||||
});
|
||||
proxy($progress, 'mouseout', function () {
|
||||
_this.option.ref.style.display = 'none';
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "checkLoad",
|
||||
value: function checkLoad(url) {
|
||||
var _this2 = this;
|
||||
|
||||
if (this.isLoad) {
|
||||
return Promise.resolve(url);
|
||||
}
|
||||
|
||||
var proxy = this.art.events.proxy;
|
||||
return new Promise(function (resolve, reject) {
|
||||
var $img = new Image();
|
||||
$img.src = url;
|
||||
|
||||
if ($img.complete) {
|
||||
_this2.isLoad = true;
|
||||
resolve(url);
|
||||
}
|
||||
|
||||
proxy($img, 'load', function () {
|
||||
_this2.isLoad = true;
|
||||
resolve(url);
|
||||
});
|
||||
proxy($img, 'error', function () {
|
||||
reject(url);
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "showThumbnails",
|
||||
value: function showThumbnails(event) {
|
||||
|
||||
Reference in new issue
Block a user