Fixed Issue of Review Menu Shown Behind (#32631)
Fixed #31144 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
703be6bf30
commit
25cacaf0aa
6 changed files with 38 additions and 26 deletions
|
@ -1,13 +1,13 @@
|
|||
import {hideElem, queryElemSiblings, showElem, toggleElem} from '../utils/dom.ts';
|
||||
import {addDelegatedEventListener, hideElem, queryElemSiblings, showElem, toggleElem} from '../utils/dom.ts';
|
||||
|
||||
export function initUnicodeEscapeButton() {
|
||||
document.addEventListener('click', (e) => {
|
||||
const btn = e.target.closest('.escape-button, .unescape-button, .toggle-escape-button');
|
||||
if (!btn) return;
|
||||
|
||||
addDelegatedEventListener(document, 'click', '.escape-button, .unescape-button, .toggle-escape-button', (btn, e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const fileContent = btn.closest('.file-content, .non-diff-file-content');
|
||||
const fileContentElemId = btn.getAttribute('data-file-content-elem-id');
|
||||
const fileContent = fileContentElemId ?
|
||||
document.querySelector(`#${fileContentElemId}`) :
|
||||
btn.closest('.file-content, .non-diff-file-content');
|
||||
const fileView = fileContent?.querySelectorAll('.file-code, .file-view');
|
||||
if (btn.matches('.escape-button')) {
|
||||
for (const el of fileView) el.classList.add('unicode-escaped');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue