Skip to content

Commit

Permalink
add iframe-resizer
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanPisani committed Mar 6, 2023
1 parent 2144c95 commit 82b930a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export default defineNuxtConfig({
app: {
baseURL: "/hc-certified-backflow-testers/",
},

plugins: [{ src: "~/plugins/iframe-resize", mode: "client" }],

This comment has been minimized.

Copy link
@mccarthyk

mccarthyk Mar 6, 2023

Contributor

@JordanPisani this line shouldn't be needed... where did you get this code?

This comment has been minimized.

Copy link
@JordanPisani

JordanPisani Mar 6, 2023

Author Contributor

davidjbradshaw/iframe-resizer#831 (comment)

Sandi is saying there's some issues on mobile, could they be related?

});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
},
"devDependencies": {
"@picocss/pico": "^1.5.7",
"@types/iframe-resizer": "^3.5.9",
"axios": "^1.3.3",
"iframe-resizer": "^4.3.5",
"nuxt": "^3.2.2",
"sass": "^1.58.3"
}
Expand Down
9 changes: 9 additions & 0 deletions plugins/iframe-resize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import iframeResize from "iframe-resizer";

This comment has been minimized.

Copy link
@mccarthyk

mccarthyk Mar 6, 2023

Contributor

@JordanPisani try replacing this with import "iframe-resizer/js/iframeResizer.contentWindow"


export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.directive("resize", {

This comment has been minimized.

Copy link
@mccarthyk

mccarthyk Mar 6, 2023

Contributor

@JordanPisani you're adding a directive but not using it anywhere... you should be able to get away with replacing line 1 with my previous comment and changing lines 3-9 with:

export default defineNuxtPlugin()
mounted(el, { value = {} }) {
el.addEventListener("load", () => iframeResize(value, el));
},
});
});
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,11 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2"
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==

"@types/iframe-resizer@^3.5.9":
version "3.5.9"
resolved "https://registry.yarnpkg.com/@types/iframe-resizer/-/iframe-resizer-3.5.9.tgz#75c4cda33cee5f4da4c7693a0d9ad1ccb0c5ee98"
integrity sha512-RQUBI75F+uXruB95BFpC/8V8lPgJg4MQ6HxOCtAZYBB/h0FNCfrFfb4I+u2pZJIV7sKeszZbFqy1UnGeBMrvsA==

"@types/resolve@1.20.2":
version "1.20.2"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975"
Expand Down Expand Up @@ -2337,6 +2342,11 @@ ieee754@^1.1.13, ieee754@^1.2.1:
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==

iframe-resizer@^4.3.5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/iframe-resizer/-/iframe-resizer-4.3.5.tgz#d8bdc843f36eaebe2dd7b258e7234f438073cf8b"
integrity sha512-pziqOCczYtbVFgzU3KcjQDS+pMhj4QgL7JutUVazt73xeIWtx+CSRlFQp7aJ2i1bUSZwgbjSP2dez4yelV76yw==

ignore@^5.2.0, ignore@^5.2.4:
version "5.2.4"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
Expand Down

0 comments on commit 82b930a

Please sign in to comment.