one-click-accessibility/modules/scanner/assets/js/utils/close-widget.js
VasylD 36d12a4e89
[APP-1432] fix with AI flow (#275)
* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow

* [APP-1432] fix with AI flow
2025-05-21 15:30:43 +02:00

9 lines
360 B
JavaScript

import { removeExistingFocus } from '@ea11y-apps/scanner/utils/focus-on-element';
export const closeWidget = (widget) => {
const isRTL = Boolean(window.ea11yScannerData?.isRTL);
removeExistingFocus();
widget.remove();
document.body.style.removeProperty(isRTL ? 'margin-left' : 'margin-right');
document.body.prepend(window.ea11yScannerData.adminBar);
};