进行了一些小修复
This commit is contained in:
@@ -94,7 +94,6 @@
|
||||
this.bindLeaveWarning();
|
||||
this.bindAi();
|
||||
this.bindTagActive();
|
||||
this.bindDropSelect();
|
||||
this.loadFeaturedFromDom();
|
||||
},
|
||||
|
||||
@@ -158,18 +157,6 @@
|
||||
});
|
||||
},
|
||||
|
||||
bindDropSelect: function () {
|
||||
qsa('.term-select-box [data-toggle-class="open"]').forEach(function (button) {
|
||||
button.addEventListener('click', function () {
|
||||
var box = button.closest('.drop-select');
|
||||
if (!box) return;
|
||||
var open = !box.classList.contains('open');
|
||||
box.classList.toggle('open', open);
|
||||
button.setAttribute('aria-expanded', open ? 'true' : 'false');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
bindSubmitButtons: function () {
|
||||
var self = this;
|
||||
qsa('.aksrt-submit-btn', this.form).forEach(function (btn) {
|
||||
|
||||
@@ -27,7 +27,7 @@ require_once get_template_directory() . '/templates/parts/submit/term-checks.php
|
||||
<div class="term-select-box">
|
||||
<?php if (!empty($settings['allow_category'])) : ?>
|
||||
<div class="newpost-cat-drop drop-select dropdown dependency-box">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-cat-drop" class="flex ac jsb drop-btn form-control mb6" aria-expanded="false">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-cat-drop" class="flex ac jsb drop-btn form-control mb6">
|
||||
<span class="title-theme222"><i class="fa fas fa-folder-open mr6" aria-hidden="true"></i><?php esc_html_e('分类', 'aksrt'); ?></span><i class="ml6 fa fas fa-angle-right em12"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu fluid">
|
||||
@@ -53,7 +53,7 @@ require_once get_template_directory() . '/templates/parts/submit/term-checks.php
|
||||
$current = (array) ($ctx['current_cf'][$key] ?? []);
|
||||
?>
|
||||
<div class="newpost-custom-filter-<?php echo esc_attr($key); ?> drop-select dropdown dependency-box">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-custom-filter-<?php echo esc_attr($key); ?>" class="flex ac jsb drop-btn form-control mb6" aria-expanded="false">
|
||||
<button type="button" data-toggle-class="open" data-target=".newpost-custom-filter-<?php echo esc_attr($key); ?>" class="flex ac jsb drop-btn form-control mb6">
|
||||
<span class="title-theme222"><i class="fa fas fa-filter mr6" aria-hidden="true"></i><?php echo esc_html($name); ?></span><i class="ml6 fa fas fa-angle-right em12"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu fluid"><div class="padding-10 select-drop-box newpost-filter-tags">
|
||||
|
||||
@@ -36,6 +36,7 @@ test('front submit follows the reference newposts shell and cards', () => {
|
||||
const terms = read('templates/parts/submit/sidebar-terms.php');
|
||||
const pay = read('templates/parts/submit/sidebar-pay.php');
|
||||
const submit = read('templates/parts/submit/sidebar-submit.php');
|
||||
const submitJs = read('assets/js/front-submit.js');
|
||||
|
||||
assert.match(page, /content-wrap newposts-wrap/);
|
||||
assert.match(page, /class="content-layout"/);
|
||||
@@ -43,6 +44,10 @@ test('front submit follows the reference newposts shell and cards', () => {
|
||||
assert.match(main, /zib-widget full-widget-sm editor-main-box/);
|
||||
assert.match(main, /relative newposts-title/);
|
||||
assert.match(terms, /newpost-cat-drop drop-select dropdown dependency-box/);
|
||||
assert.match(terms, /data-toggle-class="open" data-target="\.newpost-cat-drop"/);
|
||||
assert.match(terms, /aksrt_submit_render_term_checks\(\$ctx\['categories'\], array_map\('intval', \$ctx\['current_cats'\]\), 'category'\)/);
|
||||
assert.doesNotMatch(terms, /aria-expanded=/);
|
||||
assert.doesNotMatch(submitJs, /bindDropSelect|term-select-box \[data-toggle-class/);
|
||||
assert.match(pay, /zib-widget dependency-box mb10-sm newpost-pay-box/);
|
||||
assert.match(pay, /pay-dawnload-edit/);
|
||||
assert.match(submit, /separator muted-3-color theme-box/);
|
||||
|
||||
Reference in New Issue
Block a user