diff --git a/app/javascript/controllers/dialog_controller.js b/app/javascript/controllers/dialog_controller.js index b024bce2b..3df135c12 100644 --- a/app/javascript/controllers/dialog_controller.js +++ b/app/javascript/controllers/dialog_controller.js @@ -1,6 +1,5 @@ import { Controller } from "@hotwired/stimulus" import { orient } from "helpers/orientation_helpers" -import { limitHeightToViewport } from "helpers/sizing_helpers" export default class extends Controller { static targets = [ "dialog" ] @@ -23,8 +22,6 @@ export default class extends Controller { orient(this.dialogTarget) } - limitHeightToViewport(this.dialogTarget, this.sizingValue) - this.loadLazyFrames() this.dialogTarget.setAttribute("aria-hidden", "false") this.dispatch("show") @@ -43,7 +40,6 @@ export default class extends Controller { this.dialogTarget.setAttribute("aria-hidden", "true") this.dialogTarget.blur() orient(this.dialogTarget, false) - limitHeightToViewport(this.dialogTarget, false) this.dispatch("close") } diff --git a/app/javascript/helpers/sizing_helpers.js b/app/javascript/helpers/sizing_helpers.js deleted file mode 100644 index 4b7e99645..000000000 --- a/app/javascript/helpers/sizing_helpers.js +++ /dev/null @@ -1,12 +0,0 @@ -export function limitHeightToViewport(el, sizing = true, margin = 64) { - if (!el) return - - if (sizing) { - const rect = el.getBoundingClientRect() - const top = Math.max(rect.top, margin) - const max = Math.max(0, window.innerHeight - margin - top) - el.style.maxHeight = `${max}px` - } else { - el.style.maxHeight = "" - } -} \ No newline at end of file