Skip to content

Commit

Permalink
Merge branch 'wip-87637-m402' into MOODLE_402_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
weilai-irl committed Jun 22, 2023
2 parents 079fb8c + efd15e2 commit fc4d026
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion theme/boost_o365teams/amd/build/iframeChecker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 15 additions & 11 deletions theme/boost_o365teams/amd/src/iframeChecker.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
define(['jquery'], function ($) {
return {
init: function() {
if (window.location == window.parent.location) {
// not in iframe, show page elements
$('nav.navbar').show();
$('nav.navbar').css('display', 'flex');
$('div#nav-drawer').show();
$('section[data-region="blocks-column"]').show();
$('footer#page-footer').show();
$('div#course_page_title').css('display', 'none');
$('.popupicon').css('display', 'none');
} else {
// in iframe, hide page elements
if (in_teams()) {
// In Teams, hide page elements.
$('body.drawer-open-left').css('margin-left', '0');
$('div#page').css('margin-top', '0');
$('section#region-main.has-blocks').css('width', '100%');
Expand Down Expand Up @@ -39,8 +30,21 @@ define(['jquery'], function ($) {
$(this).attr('target', '_blank');
$(this).attr('method', 'get');
});
} else {
// Not in Teams, show page elements.
$('nav.navbar').show();
$('nav.navbar').css('display', 'flex');
$('div#nav-drawer').show();
$('section[data-region="blocks-column"]').show();
$('footer#page-footer').show();
$('div#course_page_title').css('display', 'none');
$('.popupicon').css('display', 'none');
}
$("body").fadeIn(150);
}
};

function in_teams() {
return ((window.location != window.parent.location) || (/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)));
};
});

0 comments on commit fc4d026

Please sign in to comment.