@qualweb/qw-element
Advanced tools
Comparing version 0.2.1 to 0.2.2
# Changelog | ||
## [0.2.2] - 25/03/2021 | ||
### Changes | ||
- general bugs fixed | ||
## [0.2.1] - 25/03/2021 | ||
@@ -4,0 +11,0 @@ |
@@ -106,4 +106,4 @@ "use strict"; | ||
elementHasParent(parent) { | ||
const parentElement = this.element['parentElement']; | ||
return parentElement ? parentElement['tagName'].toLowerCase() === parent.toLowerCase() : false; | ||
const parentElement = this.element.parentElement; | ||
return parentElement ? parentElement.tagName.toLowerCase() === parent.toLowerCase() : false; | ||
} | ||
@@ -137,6 +137,5 @@ hasTextNode() { | ||
getElementChildren() { | ||
const selector = this.getElementSelector(); | ||
const qwList = new Array(); | ||
const elements = this.element.querySelectorAll(selector + ' > *'); | ||
for (const element of elements || []) { | ||
const elements = this.element.children; | ||
for (const element of elements !== null && elements !== void 0 ? elements : []) { | ||
this.addCSSRulesPropertyToElement(element); | ||
@@ -148,5 +147,6 @@ qwList.push(new QWElement(element, this.elementsCSSRules)); | ||
getElementChildTextContent(childName) { | ||
var _a; | ||
for (const child of this.element.children || []) { | ||
if (child.tagName.toLowerCase() === childName.toLowerCase()) { | ||
return child['textContent'] || undefined; | ||
return (_a = child.textContent) !== null && _a !== void 0 ? _a : undefined; | ||
} | ||
@@ -165,4 +165,3 @@ } | ||
if (fullElement) { | ||
const selector = this.getElementSelector(); | ||
const children = this.element.querySelectorAll(selector + ' *'); | ||
const children = this.element.children; | ||
const attributeArray = new Array(); | ||
@@ -236,3 +235,3 @@ for (const child of children) { | ||
const qwList = new Array(); | ||
for (const element of elements || []) { | ||
for (const element of elements !== null && elements !== void 0 ? elements : []) { | ||
this.addCSSRulesPropertyToElement(element); | ||
@@ -326,3 +325,3 @@ qwList.push(new QWElement(element, this.elementsCSSRules)); | ||
getElementTagName() { | ||
return this.element['tagName'].toLowerCase(); | ||
return this.element.tagName.toLowerCase(); | ||
} | ||
@@ -337,3 +336,2 @@ getElementText() { | ||
} | ||
console.log(children); | ||
let result = ''; | ||
@@ -340,0 +338,0 @@ let textContent; |
{ | ||
"name": "@qualweb/qw-element", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "QualWeb element interface and utilities", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
24435
525