LTI integrations iframe viewport

561 views
Skip to first unread message

Ryan Hiebert

unread,
Oct 20, 2014, 8:07:50 PM10/20/14
to canvas-l...@googlegroups.com
After this weekend's updates, (my) LTI tools seem to be launching in a very short viewport, and I'm not sure how to fix it. In particular, I'm finding that the iframe is not ending up as tall as the content it contains, nor is it the same height as given by the lti lauch parameters.

Does anyone have any clues to help me figure out what's going on, what's different between this week and last, and what I need to do to correct it? It's important that the tools I write work for the schools we're working with, and right now they aren't.

Ryan

Brad Humphrey

unread,
Oct 21, 2014, 10:39:33 AM10/21/14
to canvas-l...@googlegroups.com
This is a known bug that we are currently working on.  It should be fixed soon.


       

--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Hiebert

unread,
Oct 21, 2014, 10:45:06 AM10/21/14
to canvas-l...@googlegroups.com
I'm not sure what exactly caused the problem, but a colleague of mine was able to find the best fix.

This commit added a message listener so that LTI tools can send a message to Canvas to adjust the size of the iframe it's contained in:

https://github.com/instructure/canvas-lms/commit/834aba7d2e412daefb47771ebe294426366ad36f

We were able to do something like this to solve the problem:

<script type="text/javascript">
  $(function(){
    parent.postMessage(JSON.stringify({subject: 'lti.frameResize', height: $(document).height()+"px"}), '*');
  });
</script>

Which actually works better than we ever have, because it allows us to have canvas size to our entire page, rather than having a scrolling viewport.

Brad Humphrey

unread,
Oct 21, 2014, 11:03:26 AM10/21/14
to canvas-l...@googlegroups.com
yeah, we added support for sending a post message that will allow you to resize the frame for your content.  This allows for better support of tools where the content is taller then the window, by removing the secondary scroll bar completely.  Unfortunately, with this change we made the default hight worse.

Anyway, I recommend using the postMessage approach for the best user experience.


       

--

Austin Bart

unread,
Dec 11, 2015, 11:52:31 AM12/11/15
to Canvas LMS Users
This works for LTI, does it not work for Pages content? I was hoping to follow the process outlined below to embed content from GitHub, but it seems like I have to specify a manual height for my content, and that's rather unfortunate.

Brad Humphrey

unread,
Dec 11, 2015, 12:29:17 PM12/11/15
to canvas-l...@googlegroups.com
It is a little clunky, but you can always wrap your public content in an LTI launch and ignore the POST data from canvas. Then you would have access to this feature.

Austin Bart

unread,
Dec 14, 2015, 8:02:14 PM12/14/15
to Canvas LMS Users
Hmm, not a very appealing option. But thanks!

~Cory
Reply all
Reply to author
Forward
0 new messages