Fix bug in override navbar

This commit is contained in:
the1812 2019-02-11 13:44:34 +08:00
parent 7737b806e8
commit b544b45d41
4 changed files with 12 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{return(e,n)=>{SpinQuery.any(()=>$(".head-content.bili-wrapper>div.search:not(.filter-item)"),e=>{e.detach().insertAfter(".nav-con.fr")});if(e.preserveRank){SpinQuery.any(()=>$(".nav-wrapper .searchform,.nav-con #nav_searchform"),e=>{e.addClass("preserve-rank");if(e.find("a.icons-enabled").length===0){e.prepend(`\n <a title="排行榜"\n class="icons-enabled"\n href="https://www.bilibili.com/ranking"\n target="_blank">\n <i class="icon-rank"></i>\n </a>\n `)}})}else{SpinQuery.any(()=>$(".nav-wrapper .searchform,.nav-con #nav_searchform"),e=>{e.removeClass("preserve-rank");e.find("a.icons-enabled").remove()})}SpinQuery.any(()=>$("#banner_link"),()=>n.removeStyle("tweetsStyle"));if(!e.showBanner){n.applyStyle("noBannerStyle")}else{n.removeStyle("noBannerStyle")}}})();
(()=>{return(e,n)=>{SpinQuery.any(()=>$(".head-content.bili-wrapper>div.search:not(.filter-item)"),e=>{const n=$(document.querySelector(".nav-con.fr"));e.detach().insertAfter(n)});if(e.preserveRank){SpinQuery.any(()=>$(".nav-wrapper .searchform,.nav-con #nav_searchform"),e=>{e.addClass("preserve-rank");if(e.find("a.icons-enabled").length===0){e.prepend(`\n <a title="排行榜"\n class="icons-enabled"\n href="https://www.bilibili.com/ranking"\n target="_blank">\n <i class="icon-rank"></i>\n </a>\n `)}})}else{SpinQuery.any(()=>$(".nav-wrapper .searchform,.nav-con #nav_searchform"),e=>{e.removeClass("preserve-rank");e.find("a.icons-enabled").remove()})}SpinQuery.any(()=>$("#banner_link"),()=>n.removeStyle("tweetsStyle"));if(!e.showBanner){n.applyStyle("noBannerStyle")}else{n.removeStyle("noBannerStyle")}}})();

View File

@ -6,7 +6,8 @@
() => $(".head-content.bili-wrapper>div.search:not(.filter-item)"),
textBox =>
{
textBox.detach().insertAfter(".nav-con.fr");
const rightNavbar = $(document.querySelector(".nav-con.fr"));
textBox.detach().insertAfter(rightNavbar);
},
);
if (settings.preserveRank)
@ -19,13 +20,13 @@
if (searchForm.find("a.icons-enabled").length === 0)
{
searchForm.prepend(`
<a title="排行榜"
class="icons-enabled"
href="https://www.bilibili.com/ranking"
target="_blank">
<i class="icon-rank"></i>
</a>
`);
<a title="排行榜"
class="icons-enabled"
href="https://www.bilibili.com/ranking"
target="_blank">
<i class="icon-rank"></i>
</a>
`);
}
}
);