Tower: upload web_responsive 19.0.1.0.2 (was 19.0.1.0.2, via marketplace)
All checks were successful
addon-qualify / qualify (push) Successful in 13s
All checks were successful
addon-qualify / qualify (push) Successful in 13s
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/* global requestAnimationFrame, window, document */
|
||||
/* Copyright 2018 Tecnativa - Jairo Llopis
|
||||
* Copyright 2021 ITerra - Sergey Shebanin
|
||||
* Copyright 2023 Onestein - Anjeel Haria
|
||||
* Copyright 2023 Taras Shabaranskyi
|
||||
* License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */
|
||||
|
||||
import {debounce} from "@web/core/utils/timing";
|
||||
|
||||
// Fix for iOS Safari to set correct viewport height
|
||||
// https://github.com/Faisal-Manzer/postcss-viewport-height-correction
|
||||
export function setViewportProperty(doc) {
|
||||
function handleResize() {
|
||||
requestAnimationFrame(function () {
|
||||
doc.style.setProperty("--vh100", doc.clientHeight + "px");
|
||||
});
|
||||
}
|
||||
|
||||
handleResize();
|
||||
return handleResize;
|
||||
}
|
||||
|
||||
window.addEventListener(
|
||||
"resize",
|
||||
debounce(setViewportProperty(document.documentElement), 25)
|
||||
);
|
||||
Reference in New Issue
Block a user