[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
BACKUP C 19-12
/
XAMPP74
/
htdocs
/
sisurat
/
public
/
library
/
sweetalert2
/
src
/
utils
/
[
Home
]
File: scrollbarFix.js
import * as dom from './dom/index.js' export const fixScrollbar = () => { // for queues, do not do this more than once if (dom.states.previousBodyPadding !== null) { return } // if the body has overflow if (document.body.scrollHeight > window.innerHeight) { // add padding so the content doesn't shift after removal of scrollbar dom.states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')) document.body.style.paddingRight = `${dom.states.previousBodyPadding + dom.measureScrollbar()}px` } } export const undoScrollbar = () => { if (dom.states.previousBodyPadding !== null) { document.body.style.paddingRight = `${dom.states.previousBodyPadding}px` dom.states.previousBodyPadding = null } }