UNPKG

vuesax-alpha

Version:
34 lines (29 loc) 838 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var dom = require('../../utils/dom.js'); function getViewportRect(element, strategy) { const win = dom.getWindow(element); const html = dom.getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = dom.isWebKit(); if (!visualViewportBased || visualViewportBased && strategy === "fixed") { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } exports.getViewportRect = getViewportRect; //# sourceMappingURL=get-viewport-rect.js.map