release: WRNexusJS 0.8.3
This commit is contained in:
@@ -92,6 +92,10 @@ export const UPLOAD_RUNTIME = `
|
||||
var accept = root.getAttribute("data-accept") || "";
|
||||
var maxBytes = parseInt(root.getAttribute("data-max") || "0", 10) || 0;
|
||||
var field = root.getAttribute("data-field") || (multiple ? "files" : "file");
|
||||
var invalidate = String(root.getAttribute("data-invalidate") || "")
|
||||
.split(",")
|
||||
.map(function (tag) { return tag.trim(); })
|
||||
.filter(Boolean);
|
||||
var promptText = root.getAttribute("data-label") || "Drag files here or click to browse";
|
||||
|
||||
root.classList.add("wire-uploader");
|
||||
@@ -183,6 +187,11 @@ export const UPLOAD_RUNTIME = `
|
||||
ui.fill.style.width = "100%";
|
||||
ui.status.textContent = "\\u2713 Uploaded";
|
||||
root.dispatchEvent(new CustomEvent("wrnexus:upload", { bubbles: true, detail: { file: file, result: info } }));
|
||||
if (invalidate.length) {
|
||||
window.dispatchEvent(new CustomEvent("wrnexus:cache:invalidate", {
|
||||
detail: { tags: invalidate, source: "uploader", file: file, result: info }
|
||||
}));
|
||||
}
|
||||
}
|
||||
function fail(ui, msg, file) {
|
||||
ui.li.classList.add("is-error");
|
||||
|
||||
Reference in New Issue
Block a user