Skip to content

Commit

Permalink
Bump build
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismccord committed Oct 4, 2023
1 parent e94c1b0 commit 9b26728
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 21 deletions.
21 changes: 17 additions & 4 deletions priv/static/phoenix_live_view.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.cjs.js.map

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions priv/static/phoenix_live_view.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions priv/static/phoenix_live_view.esm.js.map

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions priv/static/phoenix_live_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2399,10 +2399,12 @@ within:
this.__listeners.delete(callbackRef);
}
upload(name, files) {
return this.__view.dispatchUploads(name, files);
return this.__view.dispatchUploads(null, name, files);
}
uploadTo(phxTarget, name, files) {
return this.__view.withinTargets(phxTarget, (view) => view.dispatchUploads(name, files));
return this.__view.withinTargets(phxTarget, (view, targetCtx) => {
view.dispatchUploads(targetCtx, name, files);
});
}
__cleanup__() {
this.__listeners.forEach((callbackRef) => this.removeHandleEvent(callbackRef));
Expand Down Expand Up @@ -3610,8 +3612,9 @@ within:
});
});
}
dispatchUploads(name, filesOrBlobs) {
let inputs = dom_default.findUploadInputs(this.el).filter((el) => el.name === name);
dispatchUploads(targetCtx, name, filesOrBlobs) {
let targetElement = this.targetCtxElement(targetCtx) || this.el;
let inputs = dom_default.findUploadInputs(targetElement).filter((el) => el.name === name);
if (inputs.length === 0) {
logError(`no live file inputs found matching the name "${name}"`);
} else if (inputs.length > 1) {
Expand All @@ -3620,6 +3623,16 @@ within:
dom_default.dispatchEvent(inputs[0], PHX_TRACK_UPLOADS, { detail: { files: filesOrBlobs } });
}
}
targetCtxElement(targetCtx) {
if (isCid(targetCtx)) {
let [target] = dom_default.findComponentNodeList(this.el, targetCtx);
return target;
} else if (targetCtx) {
return targetCtx;
} else {
return null;
}
}
pushFormRecovery(form, newCid, callback) {
this.liveSocket.withinOwners(form, (view, targetCtx) => {
let phxChange = this.binding("change");
Expand Down
10 changes: 5 additions & 5 deletions priv/static/phoenix_live_view.min.js

Large diffs are not rendered by default.

0 comments on commit 9b26728

Please sign in to comment.