File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,18 @@ const show = (el) => {
8080 delete el [ DATA_STYLE_DISPLAY ] ;
8181} ;
8282
83+ /**
84+ * Test, if a element is visible or not.
85+ *
86+ * @param {Node } el - The DOM node to test.
87+ * @returns {Boolean } - True if the element is visible.
88+ */
89+ const is_visible = ( el ) => {
90+ // Check, if element is visible in DOM.
91+ // https://stackoverflow.com/a/19808107/1337474
92+ return el . offsetWidth > 0 && el . offsetHeight > 0 ;
93+ } ;
94+
8395/**
8496 * Return all direct parents of ``el`` matching ``selector``.
8597 * This matches against all parents but not the element itself.
@@ -169,12 +181,6 @@ const acquire_attribute = (
169181 }
170182} ;
171183
172- const is_visible = ( el ) => {
173- // Check, if element is visible in DOM.
174- // https://stackoverflow.com/a/19808107/1337474
175- return el . offsetWidth > 0 && el . offsetHeight > 0 ;
176- } ;
177-
178184/**
179185 * Return a DocumentFragment from a given string.
180186 *
You can’t perform that action at this time.
0 commit comments