Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables runtime changes of the iFrame autoResize function. #723

Merged
merged 2 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions example/frame.content.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
>Size(250)</a
>
&nbsp;
<a
href="#"
onclick="if ('parentIFrame' in window) window.parentIFrame.autoResize(true);return false;"
>autoResize(true)</a
>

<a
href="#"
onclick="if ('parentIFrame' in window) window.parentIFrame.autoResize(false);return false;"
>autoResize(false)</a
>

<a id="nested" href="frame.nested.html">Nested</a>
&nbsp;
<a href="frame.hover.html">:Hover</a>
Expand Down
2 changes: 1 addition & 1 deletion js/iframeResizer.contentWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
autoResize = false
stopEventListeners()
}

sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))
return autoResize
},

Expand Down
2 changes: 1 addition & 1 deletion js/iframeResizer.contentWindow.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/iframeResizer.contentWindow.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions js/iframeResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@
forwardMsgFromIFrame(getMsgBody(6))
break

case 'autoResize':
settings[iframeId].autoResize = JSON.parse(getMsgBody(9))
break

case 'scrollTo':
scrollRequestFromChild(false)
break
Expand Down
2 changes: 1 addition & 1 deletion js/iframeResizer.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/iframeResizer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/iframeResizer.contentWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
autoResize = false
stopEventListeners()
}

sendMsg(0, 0, 'autoResize', JSON.stringify(autoResize))
return autoResize
},

Expand Down
4 changes: 4 additions & 0 deletions src/iframeResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@
forwardMsgFromIFrame(getMsgBody(6))
break

case 'autoResize':
settings[iframeId].autoResize = JSON.parse(getMsgBody(9))
break

case 'scrollTo':
scrollRequestFromChild(false)
break
Expand Down