Comparing version 1.0.5 to 1.0.6
@@ -103,2 +103,3 @@ var url = document.currentScript.getAttribute('url') || 'https://qq.webrtc.win/audio/Pear-Demo-audio.mp3'; | ||
var showLink = data.showLink; | ||
var lastPercent = 0; | ||
var downloader = new PearDownloader(data.url, data.token, { | ||
@@ -115,7 +116,7 @@ // algorithm: 'firstaid', //核心算法,默认firstaid | ||
downloader.on('progress', function (progress) { | ||
var percent = (progress * 100).toFixed(); | ||
if(percent <= 0) { | ||
percent = 0 | ||
var percent = (progress * 100); | ||
if(lastPercent <= percent){ | ||
lastPercent = percent; | ||
loading.setAttribute('data-value', percent.toFixed()); | ||
} | ||
loading.setAttribute('data-value', percent); | ||
}); | ||
@@ -126,3 +127,3 @@ downloader.on('done', function () { | ||
aTag.download = downloader.fileName; | ||
aTag.innerText = downloader.fileName; | ||
aTag.innerHTML = '<u>' + downloader.fileName + '</u>'; | ||
aTag.href = url; | ||
@@ -129,0 +130,0 @@ if (autoSave == 1) { |
@@ -0,0 +0,0 @@ /*! |
{ | ||
"name": "pearbutton", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "button.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
220927
2444
0