Move update() to Plugin.js to avoid duplication

This commit is contained in:
Artur Paikin 2016-04-23 18:01:21 -04:00
parent 7ffc0ee990
commit 6502d66d0b
3 changed files with 14 additions and 25 deletions

View file

@ -18,15 +18,6 @@ export default class ProgressDrawer extends Plugin {
this.opts = Object.assign({}, defaultOptions, opts)
}
update () {
if (typeof this.el === 'undefined') {
return
}
const newEl = this.render(this.core.state)
yo.update(this.el, newEl)
}
drawerItem (file) {
const isUploaded = file.progress === 100
@ -52,7 +43,7 @@ export default class ProgressDrawer extends Plugin {
<h4 class="UppyProgressDrawer-itemName">
${file.uploadURL
? yo`<a href="${file.uploadURL}" target="_blank">${file.name}</a>`
: yo`<span>${file.name} (${file.progress})</span>`
: yo`<span>${file.name} (${file.progress}%)</span>`
}
</h4>
${isUploaded ? checkIcon : ''}