mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-06 13:46:42 +02:00
Enable a few eslint-config-xo rules (#34620)
* unicorn/prefer-dom-node-append * unicorn/prefer-dom-node-remove
This commit is contained in:
@@ -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'
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user