diff options
author | XhmikosR <xhmikosr@gmail.com> | 2021-07-30 01:23:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 01:23:00 +0300 |
commit | 6d707f4801750f1454351d6afe93a80ce4516d1a (patch) | |
tree | 168b43e7e45613dc4e6031500538626514ecec89 /js/src | |
parent | 2bf32ad18017f85380eb6daed3a314b88e1e851a (diff) |
Enable a few eslint-config-xo rules (#34620)
* unicorn/prefer-dom-node-append
* unicorn/prefer-dom-node-remove
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/modal.js | 2 | ||||
-rw-r--r-- | js/src/tooltip.js | 4 | ||||
-rw-r--r-- | js/src/util/backdrop.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index bb8d97e481..097ecd656c 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -217,7 +217,7 @@ class Modal extends BaseComponent { if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { // Don't move modal's DOM position - document.body.appendChild(this._element) + document.body.append(this._element) } this._element.style.display = 'block' diff --git a/js/src/tooltip.js b/js/src/tooltip.js index e09a53b5ce..0adde623fb 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -257,7 +257,7 @@ class Tooltip extends BaseComponent { Data.set(tip, this.constructor.DATA_KEY, this) if (!this._element.ownerDocument.documentElement.contains(this.tip)) { - container.appendChild(tip) + container.append(tip) EventHandler.trigger(this._element, this.constructor.Event.INSERTED) } @@ -402,7 +402,7 @@ class Tooltip extends BaseComponent { if (this._config.html) { if (content.parentNode !== element) { element.innerHTML = '' - element.appendChild(content) + element.append(content) } } else { element.textContent = content.textContent diff --git a/js/src/util/backdrop.js b/js/src/util/backdrop.js index fbe32445ea..30a3686f84 100644 --- a/js/src/util/backdrop.js +++ b/js/src/util/backdrop.js @@ -102,7 +102,7 @@ class Backdrop { return } - this._config.rootElement.appendChild(this._getElement()) + this._config.rootElement.append(this._getElement()) EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => { execute(this._config.clickCallback) |