Refactoring/rewrite of modal boxes handling
This commit is contained in:
@@ -88,6 +88,11 @@ KB.dom = function (tag) {
|
||||
return this;
|
||||
};
|
||||
|
||||
this.replaceText = function (text) {
|
||||
element.textContent = text;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.addClass = function (className) {
|
||||
element.classList.add(className);
|
||||
return this;
|
||||
@@ -122,6 +127,13 @@ KB.dom = function (tag) {
|
||||
return this;
|
||||
};
|
||||
|
||||
this.empty = function () {
|
||||
while (element.firstChild) {
|
||||
element.removeChild(element.firstChild);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
this.parent = function (selector) {
|
||||
for (; element && element !== document; element = element.parentNode) {
|
||||
if (element.matches(selector)) {
|
||||
|
||||
Reference in New Issue
Block a user