MCPcopy Create free account
hub / github.com/error311/FileRise / closeModalElement

Function closeModalElement

public/js/main.js:502–529  ·  view source on GitHub ↗
(modal)

Source from the content-addressed store, hash-verified

500}
501
502function closeModalElement(modal) {
503 if (!modal) return false;
504 if (typeof modal.__frClose === 'function') {
505 modal.__frClose();
506 return true;
507 }
508
509 const closeSelector = [
510 '[data-fr-modal-close]',
511 '.editor-close-btn',
512 '.restore-close-btn',
513 '.close-image-modal',
514 '.modal-close',
515 '.btn-close',
516 '[aria-label="Close"]',
517 '#confirmNoBtn',
518 '[id^="close"]',
519 '[id^="cancel"]'
520 ].join(',');
521 const closeBtn = modal.querySelector(closeSelector);
522 if (closeBtn && !closeBtn.disabled && closeBtn.getAttribute('aria-disabled') !== 'true') {
523 closeBtn.click();
524 return true;
525 }
526
527 modal.style.display = 'none';
528 return true;
529}
530
531function wireModalA11y() {
532 if (window.__FR_FLAGS.wired.modalA11y) return;

Callers 1

wireModalA11yFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected