mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-07 14:09:59 +00:00
fix: address coderabbitai review - XSS, null guards, defaults, priority sort
Amp-Thread-ID: https://ampcode.com/threads/T-019bb479-36cd-721b-8415-b0723dfeea83 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -222,13 +222,15 @@ class ManageTemplates extends ComfyDialog {
|
||||
if (target === this.draggedEl) return
|
||||
|
||||
const rect = target.getBoundingClientRect()
|
||||
if (e.clientY > rect.top + rect.height / 2) {
|
||||
target.parentNode?.insertBefore(
|
||||
this.draggedEl!,
|
||||
target.nextSibling
|
||||
)
|
||||
} else {
|
||||
target.parentNode?.insertBefore(this.draggedEl!, target)
|
||||
if (this.draggedEl) {
|
||||
if (e.clientY > rect.top + rect.height / 2) {
|
||||
target.parentNode?.insertBefore(
|
||||
this.draggedEl,
|
||||
target.nextSibling
|
||||
)
|
||||
} else {
|
||||
target.parentNode?.insertBefore(this.draggedEl, target)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user