fix(autofill): 编辑器容器选择器改为 .atk-main-editor,线上 Artalk DOM 里没有 .atk-editor,委托匹配不到导致功能空转
This commit is contained in:
1 parent
bcfa229105
commit
090262d278
1 file changed
+5
-2
@@ -33,8 +33,11 @@
|
|||||||
function isEmail(s) { return /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(s || '').trim()); }
|
function isEmail(s) { return /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(s || '').trim()); }
|
||||||
|
|
||||||
function editorOf(el) {
|
function editorOf(el) {
|
||||||
var box = el && el.closest ? el.closest('.atk-editor') : null;
|
// 线上 Artalk 的编辑器容器是 .atk-main-editor(旧版/别处可能是 .atk-editor),
|
||||||
return box || null;
|
// 兜底再往上找整个 .artalk 根 —— 宁可范围大一点,也别让委托匹配不到
|
||||||
|
return (el && el.closest)
|
||||||
|
? el.closest('.atk-main-editor, .atk-editor, .artalk, .atk-layer-wrap')
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function fieldIn(editor, name) {
|
function fieldIn(editor, name) {
|
||||||
|
|||||||
Reference in new issue
Block a user