This commit is contained in:
杜恒
2021-01-26 14:19:52 +08:00
parent 8f0a2cd6a4
commit bf1450eb2e
12 changed files with 2341 additions and 1749 deletions

View File

@@ -210,6 +210,31 @@ document.addEventListener('DOMContentLoaded', () => {
$(window).on('scroll', () => calcProgress());
}
/* 评论框点击切换画图模式和文本模式 */
{
$('.joe_comment__respond-type .item').on('click', function () {
$(this).addClass('active').siblings().removeClass('active');
if ($(this).attr('data-type') === 'draw') {
$('.joe_comment__respond-form .body .draw').show().siblings().hide();
$('#joe_comment_draw').prop('width', $('.joe_comment__respond-form .body').width());
} else {
$('.joe_comment__respond-form .body .text').show().siblings().hide();
}
});
}
/* 激活画图功能 */
{
if ($('#joe_comment_draw').length !== 0) {
window.sketchpad = new Sketchpad({
element: '#joe_comment_draw',
height: 300,
penSize: 5,
color: '303133'
});
}
}
/* 懒加载 */
new LazyLoad('.lazyload');

View File

@@ -33,7 +33,9 @@ document.addEventListener('DOMContentLoaded', () => {
/* 设置文章内的链接为新窗口打开 */
{
$('.joe_detail__article a').each(() => $(this).attr({ target: '_blank', rel: 'noopener noreferrer nofollow' }));
$('.joe_detail__article a').each(function () {
$(this).attr({ target: '_blank', rel: 'noopener noreferrer nofollow' });
});
}
/* 当前页的CID */

File diff suppressed because one or more lines are too long