forked from laysense/laysense.cn
Add category-first template library and improve admin dashboard
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
jQuery(function ($) {
|
||||
$('[data-page-list]').each(function () {
|
||||
const $panel = $(this);
|
||||
const $search = $panel.find('[data-page-search]');
|
||||
const $status = $panel.find('[data-page-status]');
|
||||
const $pages = $panel.find('[data-page-item]');
|
||||
$panel.find('[data-page-filters]').prop('hidden', false);
|
||||
$search.add($status).on('input change', function () {
|
||||
const query = $search.val().trim().toLowerCase();
|
||||
const status = $status.val();
|
||||
let count = 0;
|
||||
$pages.each(function () {
|
||||
const visible = (!status || this.dataset.pageItem === status) && this.dataset.pageLabel.toLowerCase().includes(query);
|
||||
$(this).prop('hidden', !visible);
|
||||
if (visible) count++;
|
||||
});
|
||||
$panel.find('[data-page-empty]').prop('hidden', count !== 0);
|
||||
});
|
||||
});
|
||||
|
||||
const formats = {
|
||||
markdown: {
|
||||
heading: ['## ', '', '小标题'],
|
||||
|
||||
Reference in New Issue
Block a user