mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-24 02:28:16 +08:00
Remove jQuery from repo wiki creation page (#29271)
- Switched to plain JavaScript - Tested the wiki creation form functionality and it works as before # Demo using JavaScript without jQuery  --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@ -227,3 +227,15 @@ export function initSubmitEventPolyfill() {
|
||||
document.body.addEventListener('click', submitEventPolyfillListener);
|
||||
document.body.addEventListener('focus', submitEventPolyfillListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an element is visible, equivalent to jQuery's `:visible` pseudo.
|
||||
* Note: This function doesn't account for all possible visibility scenarios.
|
||||
* @param {HTMLElement} element The element to check.
|
||||
* @returns {boolean} True if the element is visible.
|
||||
*/
|
||||
export function isElemVisible(element) {
|
||||
if (!element) return false;
|
||||
|
||||
return Boolean(element.offsetWidth || element.offsetHeight || element.getClientRects().length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user