Commit c047f532 authored by Vanessa's avatar Vanessa

记得明天去用脚本压缩

parent 2a3d386e
......@@ -437,7 +437,7 @@ a:hover > .ico-pre {
.articles > div.fn-clear {
position: relative;
margin-bottom: 20px;
margin-bottom: 50px;
}
.articles > div.fn-clear > h2 {
......
......@@ -10,7 +10,7 @@
<body>
${topBarReplacement}
<#include "header.ftl">
<ul class="nav-abs" style="padding: 0;">
<ul class="nav-abs" style="padding: 0;position: fixed">
<#list archiveDates as archiveDate>
<li data-year="${archiveDate.archiveDateYear}"
onclick="timeline.getArchive('${archiveDate.archiveDateYear}/${archiveDate.archiveDateMonth}')">
......@@ -23,7 +23,7 @@
</#list>
</ul>
<div class="wrapper">
<div class="articles container">
<div class="articles container" style="margin-top: 0">
<div class="vertical"></div>
<#list archiveDates as archiveDate>
<div class="fn-clear" id="${archiveDate.archiveDateYear}${archiveDate.archiveDateMonth}">
......
......@@ -41,9 +41,9 @@ var timeline = {
});
if (isLeft) {
$it.addClass("l");
this.className = "l";
} else {
$it.addClass("r");
this.className = "r";
}
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
......@@ -81,6 +81,7 @@ var timeline = {
var $articles = $(this).find("article");
if ($articles.length === 0) {
$(this).find("h2").remove();
$(this).css("margin-bottom" , 0);
} else {
$articles.each(function () {
var $it = $(this),
......@@ -92,9 +93,9 @@ var timeline = {
});
if (isLeft) {
$it.addClass("l");
this.className = "l";
} else {
$it.addClass("r");
this.className = "r";
}
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
......@@ -143,7 +144,7 @@ var timeline = {
+ '<div class="article-more" onclick="timeline.getNextPage(this, \''
+ archive + '\')" data-page="0">' + Label.moreLabel + '</div>';
$("#" + archiveDate).html(archiveHTML);
$("#" + archiveDate).html(archiveHTML).css("margin-bottom", "50px");
timeline.getNextPage($("#" + archiveDate).find(".article-more")[0], archive);
}
},
......@@ -219,8 +220,25 @@ var timeline = {
+ '</a></span></div></article>';
}
var colH = [parseInt($(".article-more").prev().prev().css("top")) + $(".article-more").prev().prev().outerHeight(true),
parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true)];
var colHA = parseInt($(".article-more").prev().prev().css("top")) + $(".article-more").prev().prev().outerHeight(true),
colHB = parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true);
if (archive) {
// 前面无 article
if ($(".article-more").prev()[0].tagName.toLowerCase() === "h2") {
colHA = timeline._COLHA + 60;
colHB = timeline._COLHB * 4;
}
// 前面只有1篇文章
if ($(".article-more").prev()[0].tagName.toLowerCase() === "article"
&& $(".article-more").prev().prev()[0].tagName.toLowerCase() === "h2") {
colHA = parseInt($(".article-more").prev().css("top")) + $(".article-more").prev().outerHeight(true);
colHB = timeline._COLHB * 4;
}
}
var colH = [colHA, colHB];
$more.before(articlesHTML).data("page", currentPage);
......@@ -242,9 +260,9 @@ var timeline = {
});
if (isLeft) {
$it.addClass("l");
this.className = "l";
} else {
$it.addClass("r");
this.className = "r";
}
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
......@@ -257,9 +275,12 @@ var timeline = {
toggleArchives: function (year) {
$(".nav-abs li").each(function (i) {
var $this = $(this);
if (year === $this.data("year")) {
$this.toggle();
var $it = $(this);
if (this.className !== "year") {
$it.hide();
if (year === $it.data("year")) {
$it.show();
}
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment