mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-23 17:03:34 +08:00
* [APP-934] add submit logic * [APP-934] add submit logic * [APP-934] add submit logic * [APP-934] add submit logic * Added replace remediation action * Add submit logic * Add submit alt text logic, generate AI alt text * Add AI generate request, add convert from SVG to png base64, added manual fix block * Add AI generate request, add convert from SVG to png base64, added manual fix block * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation * Add texts, add remediation submit, fix logic to store remediation --------- Co-authored-by: Raz Ohad <admin@bainternet.info>
13 lines
439 B
JavaScript
13 lines
439 B
JavaScript
import { CURRENT_ELEMENT_CLASS } from '@ea11y-apps/scanner/constants';
|
|
|
|
export const focusOnElement = (element) => {
|
|
removeExistingFocus();
|
|
element.classList.add(CURRENT_ELEMENT_CLASS);
|
|
element.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
};
|
|
|
|
export const removeExistingFocus = () => {
|
|
document.querySelectorAll(`.${CURRENT_ELEMENT_CLASS}`).forEach((element) => {
|
|
element.classList.remove(CURRENT_ELEMENT_CLASS);
|
|
});
|
|
};
|