pull/4353/head
Tuğçe Küçükoğlu 2023-08-29 15:28:15 +03:00
commit 958b347f7c
1 changed files with 4 additions and 4 deletions

View File

@ -183,13 +183,13 @@ export default {
}, },
setAttribute(element, attribute = '', value) { setAttribute(element, attribute = '', value) {
if (element && value !== null && value !== undefined) { if (this.isElement(element) && value !== null && value !== undefined) {
element.setAttribute(attribute, value); element.setAttribute(attribute, value);
} }
}, },
setAttributes(element, attributes = {}) { setAttributes(element, attributes = {}) {
if (element) { if (this.isElement(element)) {
const computedStyles = (rule, value) => { const computedStyles = (rule, value) => {
const styles = element?.$attrs?.[rule] ? [element?.$attrs?.[rule]] : []; const styles = element?.$attrs?.[rule] ? [element?.$attrs?.[rule]] : [];
@ -231,7 +231,7 @@ export default {
}, },
getAttribute(element, name) { getAttribute(element, name) {
if (element) { if (this.isElement(element)) {
const value = element.getAttribute(name); const value = element.getAttribute(name);
if (!isNaN(value)) { if (!isNaN(value)) {
@ -249,7 +249,7 @@ export default {
}, },
isAttributeEquals(element, name, value) { isAttributeEquals(element, name, value) {
return element ? this.getAttribute(element, name) === value : false; return this.isElement(element) ? this.getAttribute(element, name) === value : false;
}, },
isAttributeNotEquals(element, name, value) { isAttributeNotEquals(element, name, value) {