Skip to content

Commit

Permalink
Find parent of iframe in a single step, not traversing all the way to…
Browse files Browse the repository at this point in the history
… the root
  • Loading branch information
achlipala committed May 21, 2023
1 parent 15aaea9 commit b38b840
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/c/ajaxUpload.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ uw_Basis_string uw_AjaxUploadFfi_tweakForm(uw_context ctx, uw_Basis_bool autoSub

uw_Basis_string uw_AjaxUploadFfi_notifySuccess(uw_context ctx, uw_Basis_string submitId, uw_Basis_int handle) {
uw_Basis_string r = uw_Basis_mstrcat(ctx,
"<script type=\"text/javascript\">var subm = window.top.document.getElementById(\"",
"<script type=\"text/javascript\">var subm = parent.document.getElementById(\"",
submitId,
"\"); window.top.event = {keyCode : ",
"\"); parent.event = {keyCode : ",
uw_Basis_htmlifyInt(ctx, handle),
"}; subm.withHandle(); </script>",
NULL);
Expand All @@ -33,9 +33,9 @@ uw_Basis_string uw_AjaxUploadFfi_notifySuccess(uw_context ctx, uw_Basis_string s

uw_Basis_string uw_AjaxUploadFfi_notifyError(uw_context ctx, uw_Basis_string submitId) {
return uw_Basis_mstrcat(ctx,
"<script type=\"text/javascript\">var subm = window.top.document.getElementById(\"",
"<script type=\"text/javascript\">var subm = parent.document.getElementById(\"",
submitId,
"\"); window.top.event = {}; subm.withError(); </script>",
"\"); parent.event = {}; subm.withError(); </script>",
NULL);
}

Expand Down

0 comments on commit b38b840

Please sign in to comment.