Skip to content

Commit

Permalink
专题短标题及图片点击查看
Browse files Browse the repository at this point in the history
  • Loading branch information
yafoo committed Sep 5, 2022
1 parent 73ad7b0 commit 95a8b21
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion admin/view/special_index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
<div class="table-wrap">
<table class="layui-table">
<thead>
<tr><th>ID</th><th>标题</th><th>点击</th><th>目录地址</th><th>排序</th><th>顶部展示</th><th>侧边栏</th><th>时间</th><th>操作</th></tr>
<tr><th>ID</th><th>标题</th><th>短标题</th><th>点击</th><th>目录地址</th><th>排序</th><th>顶部展示</th><th>侧边栏</th><th>时间</th><th>操作</th></tr>
</thead>
<tbody>
{{each list item}}
<tr>
<td>{{item.id}}</td>
<td class="title">{{@item.thumb && '<img src="'+item.thumb+'" />'}}<a href="{{url(':special', {id: item.special_dir || item.id})}}" target="blank">{{item.title}}</a></td>
<td>{{item.short_title}}</td>
<td>{{item.click}}</td>
<td>{{item.special_dir}}</td>
<td>{{item.sort}}</td>
Expand Down
14 changes: 13 additions & 1 deletion app/view/special_special.htm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,19 @@ <h1>{{special.title}}</h1>
{{block 'js'}}
{{if ~special_modules.indexOf('markdown')}}
<script src="/static/common/highlight/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<script>
hljs.highlightAll();
// 文章图片点击查看
$('article.content>p>img').each(function() {
var that = $(this);
if(that.attr('alt')) {
that.attr('title', that.attr('alt'));
}
that.click(function() {
window.open(that.attr('src'));
});
});
</script>
{{/if}}
{{if ~special_modules.indexOf('map')}}
<script src="/static/common/vue/3.2.37.min.js"></script>
Expand Down

0 comments on commit 95a8b21

Please sign in to comment.