mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
20 lines
483 B
JavaScript
20 lines
483 B
JavaScript
'use strict';
|
|
|
|
require('domtokenlist-shim');
|
|
|
|
const _scrollIntoViewIfNeeded = require('scroll-into-view-if-needed');
|
|
|
|
globalThis.DOM = globalThis.DOM || {};
|
|
|
|
const scrollIntoViewIfNeeded = (el, overrides = {}) => {
|
|
const {
|
|
scroll = _scrollIntoViewIfNeeded,
|
|
} = overrides;
|
|
|
|
return scroll(el, {
|
|
block: 'nearest',
|
|
});
|
|
};
|
|
|
|
globalThis.DOM.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;
|
|
module.exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;
|