Merge pull request #5793 from G-Chubinidze/gc_SCI_8663

Clunky parts: button initialization when P/E/T view is changed [SCI-8663]
This commit is contained in:
artoscinote 2023-07-18 08:14:58 +02:00 committed by GitHub
commit 3e5de32105
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -249,9 +249,12 @@ var HelperModule = (function(){
return exit;
});
const RESIZE_OBSERVER = new ResizeObserver(function(entries) {
entries.forEach((entry) => {
if (entry.target.offsetWidth <= parseInt(entry.target.getAttribute('data-width-breakpoint'))) {
const RESIZE_OBSERVER = new ResizeObserver(entries => {
entries.forEach(entry => {
const { offsetWidth } = entry.target;
const breakpoint = parseInt(entry.target.getAttribute('data-width-breakpoint'));
if (offsetWidth <= breakpoint && offsetWidth !== 0) {
entry.target.classList.add('narrow');
} else {
entry.target.classList.remove('narrow');