Commit c047f532 authored by Vanessa's avatar Vanessa

记得明天去用脚本压缩

parent 2a3d386e
...@@ -437,7 +437,7 @@ a:hover > .ico-pre { ...@@ -437,7 +437,7 @@ a:hover > .ico-pre {
.articles > div.fn-clear { .articles > div.fn-clear {
position: relative; position: relative;
margin-bottom: 20px; margin-bottom: 50px;
} }
.articles > div.fn-clear > h2 { .articles > div.fn-clear > h2 {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<body> <body>
${topBarReplacement} ${topBarReplacement}
<#include "header.ftl"> <#include "header.ftl">
<ul class="nav-abs" style="padding: 0;"> <ul class="nav-abs" style="padding: 0;position: fixed">
<#list archiveDates as archiveDate> <#list archiveDates as archiveDate>
<li data-year="${archiveDate.archiveDateYear}" <li data-year="${archiveDate.archiveDateYear}"
onclick="timeline.getArchive('${archiveDate.archiveDateYear}/${archiveDate.archiveDateMonth}')"> onclick="timeline.getArchive('${archiveDate.archiveDateYear}/${archiveDate.archiveDateMonth}')">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</#list> </#list>
</ul> </ul>
<div class="wrapper"> <div class="wrapper">
<div class="articles container"> <div class="articles container" style="margin-top: 0">
<div class="vertical"></div> <div class="vertical"></div>
<#list archiveDates as archiveDate> <#list archiveDates as archiveDate>
<div class="fn-clear" id="${archiveDate.archiveDateYear}${archiveDate.archiveDateMonth}"> <div class="fn-clear" id="${archiveDate.archiveDateYear}${archiveDate.archiveDateMonth}">
......
...@@ -41,9 +41,9 @@ var timeline = { ...@@ -41,9 +41,9 @@ var timeline = {
}); });
if (isLeft) { if (isLeft) {
$it.addClass("l"); this.className = "l";
} else { } else {
$it.addClass("r"); this.className = "r";
} }
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true)); colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
...@@ -81,6 +81,7 @@ var timeline = { ...@@ -81,6 +81,7 @@ var timeline = {
var $articles = $(this).find("article"); var $articles = $(this).find("article");
if ($articles.length === 0) { if ($articles.length === 0) {
$(this).find("h2").remove(); $(this).find("h2").remove();
$(this).css("margin-bottom" , 0);
} else { } else {
$articles.each(function () { $articles.each(function () {
var $it = $(this), var $it = $(this),
...@@ -92,9 +93,9 @@ var timeline = { ...@@ -92,9 +93,9 @@ var timeline = {
}); });
if (isLeft) { if (isLeft) {
$it.addClass("l"); this.className = "l";
} else { } else {
$it.addClass("r"); this.className = "r";
} }
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true)); colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
...@@ -143,7 +144,7 @@ var timeline = { ...@@ -143,7 +144,7 @@ var timeline = {
+ '<div class="article-more" onclick="timeline.getNextPage(this, \'' + '<div class="article-more" onclick="timeline.getNextPage(this, \''
+ archive + '\')" data-page="0">' + Label.moreLabel + '</div>'; + 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); timeline.getNextPage($("#" + archiveDate).find(".article-more")[0], archive);
} }
}, },
...@@ -219,8 +220,25 @@ var timeline = { ...@@ -219,8 +220,25 @@ var timeline = {
+ '</a></span></div></article>'; + '</a></span></div></article>';
} }
var colH = [parseInt($(".article-more").prev().prev().css("top")) + $(".article-more").prev().prev().outerHeight(true), var colHA = parseInt($(".article-more").prev().prev().css("top")) + $(".article-more").prev().prev().outerHeight(true),
parseInt($(".article-more").prev().css("top")) + $(".article-more").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); $more.before(articlesHTML).data("page", currentPage);
...@@ -242,9 +260,9 @@ var timeline = { ...@@ -242,9 +260,9 @@ var timeline = {
}); });
if (isLeft) { if (isLeft) {
$it.addClass("l"); this.className = "l";
} else { } else {
$it.addClass("r"); this.className = "r";
} }
colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true)); colH[( isLeft ? '0' : '1' )] += parseInt($it.outerHeight(true));
...@@ -257,9 +275,12 @@ var timeline = { ...@@ -257,9 +275,12 @@ var timeline = {
toggleArchives: function (year) { toggleArchives: function (year) {
$(".nav-abs li").each(function (i) { $(".nav-abs li").each(function (i) {
var $this = $(this); var $it = $(this);
if (year === $this.data("year")) { if (this.className !== "year") {
$this.toggle(); $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