Refactoring/rewrite of modal boxes handling

This commit is contained in:
Frederic Guillot
2017-01-02 17:01:27 -05:00
parent d49ce63e51
commit 3833c12ccc
173 changed files with 1526 additions and 1654 deletions

View File

@@ -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)) {