进行了一些小修复

This commit is contained in:
2026-08-26 17:32:26 +08:00
parent bfc16de962
commit 1f84e6aa18
3 changed files with 11 additions and 3 deletions
+5
View File
@@ -149,6 +149,11 @@
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}
.aksrt-editor-media__dialog:focus {
outline: 0;
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.2);
}
.aksrt-editor-media__close {
position: absolute;
z-index: 2;
+3 -3
View File
@@ -110,7 +110,7 @@
root.innerHTML =
'<button type="button" class="aksrt-editor-media__backdrop" data-editor-media-close tabindex="-1" aria-label="' +
escapeAttr(i18n.close || '关闭') + '"></button>' +
'<div class="aksrt-editor-media__dialog">' +
'<div class="aksrt-editor-media__dialog" tabindex="-1">' +
'<button type="button" class="aksrt-editor-media__close" data-editor-media-close aria-label="' +
escapeAttr(i18n.close || '关闭') + '">&times;</button>' +
'<h3 id="aksrt-editor-media-title" class="aksrt-editor-media__title">' +
@@ -268,9 +268,9 @@
};
activeModal = { root: root, onKeydown: onKeydown };
document.addEventListener('keydown', onKeydown);
var focusTarget = root.querySelector('[data-editor-media-tab].is-active');
var focusTarget = root.querySelector('.aksrt-editor-media__dialog');
if (focusTarget) {
focusTarget.focus();
focusTarget.focus({ preventScroll: true });
}
}
@@ -65,6 +65,9 @@ test('front submit image and visibility actions live in the TinyMCE toolbar', ()
assert.match(editor, /type:\s*'menubutton'/);
assert.match(editor, /data-editor-media-tab="upload"/);
assert.match(editor, /data-editor-media-tab="external"/);
assert.match(editor, /class="aksrt-editor-media__dialog" tabindex="-1"/);
assert.match(editor, /querySelector\('\.aksrt-editor-media__dialog'\)/);
assert.doesNotMatch(editor, /focusTarget\s*=\s*root\.querySelector\('\[data-editor-media-tab\]\.is-active'\)/);
assert.match(editor, /\(cfg\.uploads \|\| \{\}\)\.image/);
assert.match(page, /'canUploadImage'\s*=>\s*!empty\(\$ctx\['can_upload_img'\]\)/);
assert.doesNotMatch(main, /newposts-editor-tools|data-insert-shortcode|data-insert-upload-image/);