mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-07 20:22:27 +03:00
update repo structure
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { each } from '../utils/array';
|
||||
import { contents } from './traversal';
|
||||
import { removeElements } from './manipulation';
|
||||
/**
|
||||
* Creates a div DOM node.
|
||||
*/
|
||||
export const createDiv = (classNames) => {
|
||||
const div = document.createElement('div');
|
||||
if (classNames) {
|
||||
div.setAttribute('class', classNames);
|
||||
}
|
||||
return div;
|
||||
};
|
||||
/**
|
||||
* Creates DOM nodes modeled after the passed html string and returns the root dom nodes as a array.
|
||||
* @param html The html string after which the DOM nodes shall be created.
|
||||
*/
|
||||
export const createDOM = (html) => {
|
||||
const createdDiv = createDiv();
|
||||
createdDiv.innerHTML = html.trim();
|
||||
return each(contents(createdDiv), (elm) => removeElements(elm));
|
||||
};
|
||||
//# sourceMappingURL=create.js.map
|
||||
Reference in New Issue
Block a user