Fix theme_boosto365teams not applied issue in Teams mobile apps for iOS and Android
This commit is contained in:
Родитель
1ea3bfa767
Коммит
a5038f3699
|
@ -1 +1 @@
|
|||
define(["jquery"],function(t){return{init:function(){window.location==window.parent.location?(t("nav.navbar").show(),t("nav.navbar").css("display","flex"),t("div#nav-drawer").show(),t('section[data-region="blocks-column"]').show(),t("footer#page-footer").show(),t("div#course_page_title").css("display","none"),t(".popupicon").css("display","none")):(t("body.drawer-open-left").css("margin-left","0"),t("div#page").css("margin-top","0"),t("section#region-main.has-blocks").css("width","100%"),t("div#page-wrapper").css("margin-bottom","0"),t("div.context-header-settings-menu").remove(),t("div.region-main-settings-menu").remove(),t("div.region_main_settings_menu_proxy").remove(),t("div.action-menu-trigger").remove(),t("div.ml-auto").remove(),t("a.printicon").remove(),t("header#page-header").css("display","none"),t(".activityinstance a").click(function(){t(this).attr("target","_blank")}),t(".modtype_assign .activityinstance a").click(function(){t(this).attr("target","_self")}),t(".modtype_quiz .activityinstance a").click(function(){t(this).attr("target","_self")}),t("#page-mod-assign-view .submissionlinks a").click(function(){t(this).attr("target","_blank")}),t(".quizattempt .singlebutton form").click(function(){t(this).attr("target","_blank"),t(this).attr("method","get")})),t("body").fadeIn(150)}}});
|
||||
define(["jquery"],function(t){return{init:function(){window.location!=window.parent.location||/Android|iPhone|iPad|iPod/i.test(navigator.userAgent)?(t("body.drawer-open-left").css("margin-left","0"),t("div#page").css("margin-top","0"),t("section#region-main.has-blocks").css("width","100%"),t("div#page-wrapper").css("margin-bottom","0"),t("div.context-header-settings-menu").remove(),t("div.region-main-settings-menu").remove(),t("div.region_main_settings_menu_proxy").remove(),t("div.action-menu-trigger").remove(),t("div.ml-auto").remove(),t("a.printicon").remove(),t("header#page-header").css("display","none"),t(".activityinstance a").click(function(){t(this).attr("target","_blank")}),t(".modtype_assign .activityinstance a").click(function(){t(this).attr("target","_self")}),t(".modtype_quiz .activityinstance a").click(function(){t(this).attr("target","_self")}),t("#page-mod-assign-view .submissionlinks a").click(function(){t(this).attr("target","_blank")}),t(".quizattempt .singlebutton form").click(function(){t(this).attr("target","_blank"),t(this).attr("method","get")})):(t("nav.navbar").show(),t("nav.navbar").css("display","flex"),t("div#nav-drawer").show(),t('section[data-region="blocks-column"]').show(),t("footer#page-footer").show(),t("div#course_page_title").css("display","none"),t(".popupicon").css("display","none")),t("body").fadeIn(150)}}});
|
|
@ -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%');
|
||||
|
@ -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)));
|
||||
};
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче