@qualweb/qw-element
Advanced tools
Comparing version 0.2.0 to 0.2.1
# Changelog | ||
## [0.2.1] - 25/03/2021 | ||
### Added | ||
- typedoc to generate documentation | ||
### Updated | ||
- dependencies | ||
## [0.2.0] - 25/03/2021 | ||
@@ -4,0 +14,0 @@ |
@@ -46,3 +46,3 @@ /// <reference types="@qualweb/types" /> | ||
setElementAttribute(attribute: string, value: string): void; | ||
concatANames(aNames: string[]): string; | ||
concatANames(aNames: Array<string>): string; | ||
isOffScreen(): boolean; | ||
@@ -49,0 +49,0 @@ isElementHTMLElement(): boolean; |
@@ -276,3 +276,3 @@ "use strict"; | ||
let selector = ''; | ||
const parents = []; | ||
const parents = new Array(); | ||
let parent = this.element.parentElement; | ||
@@ -420,8 +420,10 @@ while (parent) { | ||
elementHasTextNode() { | ||
if (this.element.firstChild !== null) { | ||
return this.element.firstChild.nodeType === 3; | ||
if (this.element.childNodes !== null) { | ||
const nodes = this.element.childNodes; | ||
for (const node of nodes) { | ||
if (node.nodeType === 3 && node.textContent && node.textContent.trim() !== '') | ||
return true; | ||
} | ||
} | ||
else { | ||
return false; | ||
} | ||
return false; | ||
} | ||
@@ -428,0 +430,0 @@ noParentScrolled(offset) { |
{ | ||
"name": "@qualweb/qw-element", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "QualWeb element interface and utilities", | ||
@@ -17,2 +17,3 @@ "main": "dist/index.js", | ||
"build": "npm run format && npm run prebuild && tsc --build", | ||
"docs": "typedoc --out docs src/index.ts", | ||
"prepare": "npm run build" | ||
@@ -19,0 +20,0 @@ }, |
24440
527