From 8ccdf653067d4fea57701f5e87de1d6eb0dfef72 Mon Sep 17 00:00:00 2001 From: Evan Battaglia Date: Wed, 2 Mar 2022 16:53:14 +0000 Subject: [PATCH] Revert "change the minimum height of the iframe used for LTI messages" This reverts commit 078a06d50e146b37886977b297b43db235b9b3da. Reason for revert: Broke some iframe heights in canaries Change-Id: I3a594dc516c4ba03ec1fbd4a24f67a5223c54827 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/285820 Tested-by: Service Cloud Jenkins QA-Review: Evan Battaglia Product-Review: Evan Battaglia Reviewed-by: Mark Starkman --- app/stylesheets/base/_layout.scss | 4 +-- .../external_tools/ToolInlineSpec.js | 31 ++----------------- ui/shared/lti/jquery/tool_launch_resizer.js | 3 +- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/app/stylesheets/base/_layout.scss b/app/stylesheets/base/_layout.scss index 0cb864e2dd9..5a51575d5a2 100644 --- a/app/stylesheets/base/_layout.scss +++ b/app/stylesheets/base/_layout.scss @@ -119,10 +119,10 @@ div.content_notice { iframe.info_alert_outline { border: 2px solid #0374B5 !important; -} +} iframe.tool_launch { - min-height: 100%; + min-height: 450px; width: 100%; height: 100%; border: none; diff --git a/spec/coffeescripts/external_tools/ToolInlineSpec.js b/spec/coffeescripts/external_tools/ToolInlineSpec.js index 3368af0515c..b7fdc0e8c6b 100644 --- a/spec/coffeescripts/external_tools/ToolInlineSpec.js +++ b/spec/coffeescripts/external_tools/ToolInlineSpec.js @@ -111,45 +111,18 @@ test('does not resize any other container', () => { equal($('.tool_content_wrapper').height(), 300) }) -test('defaults the resize height to the height of `#tool_content`', () => { +test('defaults the resize height to 450px', () => { document.querySelector('#second-wrapper').className = '' - const launchResizer = new ToolLaunchResizer() - launchResizer.resize_tool_content_wrapper() - equal( - document.querySelector('.tool_content_wrapper').style.height, - document.querySelector('#tool_content').style.height - ) - document.querySelector('#second-wrapper').className = 'tool_content_wrapper' -}) - -test('defaults the resize height to 450px if no `#tool_content` is found', () => { - document.querySelector('#second-wrapper').className = '' - document.querySelectorAll('#tool_content').forEach(element => { - element.id = 'another_tool_content' - }) - const launchResizer = new ToolLaunchResizer() launchResizer.resize_tool_content_wrapper() equal($('.tool_content_wrapper').height(), 450) - - document.querySelectorAll('#another_tool_content').forEach(element => { - element.id = 'tool_content' - }) document.querySelector('#second-wrapper').className = 'tool_content_wrapper' }) -test('defaults the resize height to 450px if non numeric value passed and no `#tool_content` is found', () => { +test('defaults the resize height to 450px if non numeric value passed', () => { document.querySelector('#second-wrapper').className = '' - document.querySelectorAll('#tool_content').forEach(element => { - element.id = 'another_tool_content' - }) - const launchResizer = new ToolLaunchResizer() launchResizer.resize_tool_content_wrapper({a: 1}) equal($('.tool_content_wrapper').height(), 450) - - document.querySelectorAll('#another_tool_content').forEach(element => { - element.id = 'tool_content' - }) document.querySelector('#second-wrapper').className = 'tool_content_wrapper' }) diff --git a/ui/shared/lti/jquery/tool_launch_resizer.js b/ui/shared/lti/jquery/tool_launch_resizer.js index c58540dd698..754ba7de965 100644 --- a/ui/shared/lti/jquery/tool_launch_resizer.js +++ b/ui/shared/lti/jquery/tool_launch_resizer.js @@ -20,8 +20,7 @@ import $ from 'jquery' export default class ToolLaunchResizer { constructor(minToolHeight) { - this.minToolHeight = - minToolHeight || document.querySelector('#tool_content')?.style.height || 450 + this.minToolHeight = minToolHeight || 450 } sanitizedWrapperId(wrapperId) {