🐛 nijigen 文章自定义页面切换
This commit is contained in:
parent
b1349979a6
commit
ab99a1c139
@ -54,7 +54,7 @@
|
|||||||
<div class="main">
|
<div class="main">
|
||||||
<div id="pjax" class="content">
|
<div id="pjax" class="content">
|
||||||
<#if pjax><!---- pjax {#pjax} start ----></#if>
|
<#if pjax><!---- pjax {#pjax} start ----></#if>
|
||||||
<main class="article-list">
|
<main class="article-list" id="articlePage">
|
||||||
<div class="item item--active">
|
<div class="item item--active">
|
||||||
<time class="tooltipped tooltipped__n item__date"
|
<time class="tooltipped tooltipped__n item__date"
|
||||||
aria-label="${article.articleCreateDate?string("yyyy")}${yearLabel}">
|
aria-label="${article.articleCreateDate?string("yyyy")}${yearLabel}">
|
||||||
|
@ -71,7 +71,7 @@ var Skin = {
|
|||||||
init: function () {
|
init: function () {
|
||||||
Util.initPjax(function () {
|
Util.initPjax(function () {
|
||||||
Skin._initAnimation()
|
Skin._initAnimation()
|
||||||
if (!Util.isArticlePage(location.href)) {
|
if ($('#articlePage').length === 0) {
|
||||||
$('.b3-solo-list').closest('.module').remove()
|
$('.b3-solo-list').closest('.module').remove()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
2
nijigen/js/common.min.js
vendored
2
nijigen/js/common.min.js
vendored
@ -15,4 +15,4 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
var Skin={_initCommon:function(e){$(window).scroll(function(){$(window).scrollTop()>125?e.show():e.hide()})},_initAnimation:function(){if(!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?(window.imageIntersectionObserver.disconnect(),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})):(window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||$(e.target).closest(".article-list").hasClass("content"))return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)}))},init:function(){Util.initPjax(function(){Skin._initAnimation(),Util.isArticlePage(location.href)||$(".b3-solo-list").closest(".module").remove()}),Skin._initAnimation(),$("body").on("click",".content-reset img",function(){window.open(this.src)}),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a, .header__m a").removeClass("current"),this.className="current",$(".header__m .module__list").hide()}),$(".header__logo").click(function(){$(".header__nav a, .header__m a").removeClass("current")})},_initArticleCommon:function(){$(".b3-solo-list li").length>0&&$(window).width()>1e3&&($(".side").prepend('<div class="module"><div class="module__list"></div></div>'),$(".side .module:eq(0) .module__list").html($(".b3-solo-list")))},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init();
|
var Skin={_initCommon:function(e){$(window).scroll(function(){$(window).scrollTop()>125?e.show():e.hide()})},_initAnimation:function(){if(!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?(window.imageIntersectionObserver.disconnect(),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})):(window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||$(e.target).closest(".article-list").hasClass("content"))return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)}))},init:function(){Util.initPjax(function(){Skin._initAnimation(),0===$("#articlePage").length&&$(".b3-solo-list").closest(".module").remove()}),Skin._initAnimation(),$("body").on("click",".content-reset img",function(){window.open(this.src)}),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}).click(function(){$(".header__nav a, .header__m a").removeClass("current"),this.className="current",$(".header__m .module__list").hide()}),$(".header__logo").click(function(){$(".header__nav a, .header__m a").removeClass("current")})},_initArticleCommon:function(){$(".b3-solo-list li").length>0&&$(window).width()>1e3&&($(".side").prepend('<div class="module"><div class="module__list"></div></div>'),$(".side .module:eq(0) .module__list").html($(".b3-solo-list")))},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init();
|
Loading…
x
Reference in New Issue
Block a user