Skip to content

Commit 3081884

Browse files
committed
postmessage scrolltotop
1 parent 9c0a7e5 commit 3081884

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

static/js/main.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ $(document).ready(function() {
2828
var lti_id = $(this).attr('id');
2929
var lti_course_navigation = $(this).data('coursenav')
3030
$.get( "get_sessionless_url/" + lti_id + "/" + lti_course_navigation, function( data ) {
31-
document.body.scrollTop = 0; // For Safari
32-
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
31+
// IE 8 & 9 only support string data, so send objects as string
32+
parent.postMessage(JSON.stringify({
33+
subject: "lti.scrollToTop",
34+
}), "*");
35+
3336
window.location.href = data;
3437
});
3538

0 commit comments

Comments
 (0)