Last active
March 30, 2017 07:24
-
-
Save Ern-st/5c75a63a71427e59388e4b7ec3c564a6 to your computer and use it in GitHub Desktop.
Fix nav header injection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fix: Der skal tilføjes ".o365cs-nav-centerAlign " 5 steder i koden. | |
NEW ⬇ | |
var count = 0; | |
var logo = "/sites/itcfyn/Style%20Library/itcfyn_custom/itc_logo_white_only.png"; | |
//var logo = "/sites/itcfyn/Style%20Library/itcfyn_custom/demo_banner.png"; | |
var id = setInterval(function () { | |
if ($(".o365cs-nav-centerAlign #O365_MainLink_TenantLogoImg") !== undefined | |
&& $(".o365cs-nav-centerAlign #O365_MainLink_TenantLogoImg").attr('src') !== undefined | |
&& $(".o365cs-nav-centerAlign #O365_MainLink_TenantLogoImg").attr('src').indexOf(logo) > -1){ | |
count++; | |
if (count > 10) { | |
clearInterval(id); | |
} | |
} | |
if (location.href.indexOf("https://o365itcfyn.sharepoint.com/sites/itcfyn") > -1) { | |
$(".o365cs-nav-header").css({ "background-image": "url()" }); | |
$(".o365cs-nav-centerAlign #O365_MainLink_TenantLogoImg").attr('src', logo); | |
$(".o365cs-nav-centerAlign #O365_MainLink_TenantLogo").attr('href', "/sites/itcfyn"); | |
//clearInterval(id); | |
} | |
}, 150); | |
OLD ⬇ | |
var count = 0; | |
var logo = "/sites/itcfyn/Style%20Library/itcfyn_custom/itc_logo_white_only.png"; | |
//var logo = "/sites/itcfyn/Style%20Library/itcfyn_custom/demo_banner.png"; | |
var id = setInterval(function () { | |
if ($("#O365_MainLink_TenantLogoImg") !== undefined | |
&& $("#O365_MainLink_TenantLogoImg").attr('src') !== undefined | |
&& $("#O365_MainLink_TenantLogoImg").attr('src').indexOf(logo) > -1){ | |
count++; | |
if (count > 10) { | |
clearInterval(id); | |
} | |
} | |
if (location.href.indexOf("https://o365itcfyn.sharepoint.com/sites/itcfyn") > -1) { | |
$(".o365cs-nav-header").css({ "background-image": "url()" }); | |
$("#O365_MainLink_TenantLogoImg").attr('src', logo); | |
$("#O365_MainLink_TenantLogo").attr('href', "/sites/itcfyn"); | |
//clearInterval(id); | |
} | |
}, 150); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment