Compare commits

...

2 Commits

Author SHA1 Message Date
mayx d6274791a8 Update 2 files
- /assets/js/pjax.js
- /index.html
2026-05-21 10:11:01 +00:00
mayx 111dc1e25f Update 2 files
- /assets/js/pjax.js
- /index.html
2026-05-21 08:27:59 +00:00
2 changed files with 4 additions and 7 deletions

View File

@ -260,6 +260,8 @@
/** PJAX 完成后的统一处理 */
function doPjaxComplete() {
$('body').removeClass('pjax-loading');
// 清理可能残留的浮层(如推荐文章 tooltiphover 后点击跳转时 mouseleave 来不及触发)
$('.content-tooltip').hide();
// go() 路径:脚本在 DOM 替换前提取到了 _pendingScripts需在此执行
// pjax 库路径_pendingScripts 为空pjax 库自行处理了脚本执行
if (_pendingScripts.length > 0) {
@ -271,11 +273,6 @@
/** 暴露给模板内 onclick/onchange 调用的导航函数 */
window.go = function (url) {
if (!url || url === '#') return;
if (/^(https?:)?\/\//.test(url) || url.startsWith('mailto:')) {
window.location.href = url;
return;
}
$('body').addClass('pjax-loading');
$.ajax({
url: url,
@ -351,4 +348,4 @@
reinitCopyButtons();
});
})(jQuery);
})(jQuery);

View File

@ -12,7 +12,7 @@ image: https://screenshot.mayx.eu.org/
<!-- 遍历分页后的文章 -->
<table class="entry-content h-feed">
{% 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>
<p>
<time class="date dt-published" datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%-d %B %Y" }}</time>