mirror of https://github.com/Mabbs/mabbs.github.io
Compare commits
2 Commits
c4ae25dcb1
...
d6274791a8
| Author | SHA1 | Date |
|---|---|---|
|
|
d6274791a8 | |
|
|
111dc1e25f |
|
|
@ -260,6 +260,8 @@
|
||||||
/** PJAX 完成后的统一处理 */
|
/** PJAX 完成后的统一处理 */
|
||||||
function doPjaxComplete() {
|
function doPjaxComplete() {
|
||||||
$('body').removeClass('pjax-loading');
|
$('body').removeClass('pjax-loading');
|
||||||
|
// 清理可能残留的浮层(如推荐文章 tooltip,hover 后点击跳转时 mouseleave 来不及触发)
|
||||||
|
$('.content-tooltip').hide();
|
||||||
// go() 路径:脚本在 DOM 替换前提取到了 _pendingScripts,需在此执行
|
// go() 路径:脚本在 DOM 替换前提取到了 _pendingScripts,需在此执行
|
||||||
// pjax 库路径:_pendingScripts 为空,pjax 库自行处理了脚本执行
|
// pjax 库路径:_pendingScripts 为空,pjax 库自行处理了脚本执行
|
||||||
if (_pendingScripts.length > 0) {
|
if (_pendingScripts.length > 0) {
|
||||||
|
|
@ -271,11 +273,6 @@
|
||||||
|
|
||||||
/** 暴露给模板内 onclick/onchange 调用的导航函数 */
|
/** 暴露给模板内 onclick/onchange 调用的导航函数 */
|
||||||
window.go = function (url) {
|
window.go = function (url) {
|
||||||
if (!url || url === '#') return;
|
|
||||||
if (/^(https?:)?\/\//.test(url) || url.startsWith('mailto:')) {
|
|
||||||
window.location.href = url;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$('body').addClass('pjax-loading');
|
$('body').addClass('pjax-loading');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ image: https://screenshot.mayx.eu.org/
|
||||||
<!-- 遍历分页后的文章 -->
|
<!-- 遍历分页后的文章 -->
|
||||||
<table class="entry-content h-feed">
|
<table class="entry-content h-feed">
|
||||||
{% for post in paginator.posts %}
|
{% for post in paginator.posts %}
|
||||||
<tr><td class="h-entry" onclick="go('{{ post.url }}')">
|
<tr><td class="h-entry" onclick="if (!event.target.closest('a.p-category')) go('{{ post.url }}')">
|
||||||
<h2 class="p-name"><a class="post-link u-url" href="{{ post.url }}">{{ post.title }}{% if post.layout == "encrypt" %} [加密] {% endif %}</a></h2>
|
<h2 class="p-name"><a class="post-link u-url" href="{{ post.url }}">{{ post.title }}{% if post.layout == "encrypt" %} [加密] {% endif %}</a></h2>
|
||||||
<p>
|
<p>
|
||||||
<time class="date dt-published" datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%-d %B %Y" }}</time>
|
<time class="date dt-published" datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%-d %B %Y" }}</time>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue