fire input event when file is read, fix deprecated func and improved display
This commit is contained in:
parent
e3efc70bad
commit
f7cd0932b5
|
@ -524,7 +524,10 @@ class CCPFileInputWidgetController extends CCPBaseInputWidgetController {
|
|||
encoded += '='.repeat(4 - (encoded.length % 4));
|
||||
}
|
||||
this.value[index] = encoded
|
||||
this.querySelector("small[name=preview]").textContent = encoded.substr(0, 5) + "..." + encoded.substr(encoded.length - 5)
|
||||
this.querySelector("small[name=preview]").textContent =
|
||||
encoded.length > 15 ? encoded.substring(0, 5) + "..." + encoded.substring(encoded.length - 5) : encoded
|
||||
const newev = new Event("input", { bubbles : true})
|
||||
this.dispatchEvent(newev)
|
||||
})
|
||||
reader.readAsDataURL(file)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue