mirror of https://github.com/Mabbs/mabbs.github.io
Compare commits
No commits in common. "d6274791a8f794d11e7e9acc58c3d45abe11a76c" and "c4ae25dcb16513f76870d07c95ebc94ba6e7cf49" have entirely different histories.
d6274791a8
...
c4ae25dcb1
|
|
@ -260,8 +260,6 @@
|
|||
/** PJAX 完成后的统一处理 */
|
||||
function doPjaxComplete() {
|
||||
$('body').removeClass('pjax-loading');
|
||||
// 清理可能残留的浮层(如推荐文章 tooltip,hover 后点击跳转时 mouseleave 来不及触发)
|
||||
$('.content-tooltip').hide();
|
||||
// go() 路径:脚本在 DOM 替换前提取到了 _pendingScripts,需在此执行
|
||||
// pjax 库路径:_pendingScripts 为空,pjax 库自行处理了脚本执行
|
||||
if (_pendingScripts.length > 0) {
|
||||
|
|
@ -273,6 +271,11 @@
|
|||
|
||||
/** 暴露给模板内 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,
|
||||
|
|
@ -348,4 +351,4 @@
|
|||
reinitCopyButtons();
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
})(jQuery);
|
||||
|
|
|
|||
|
|
@ -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="if (!event.target.closest('a.p-category')) go('{{ post.url }}')">
|
||||
<tr><td class="h-entry" onclick="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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue