mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-20 20:00:36 +03:00
Change element.parentNode.removeChild(element) to element.remove() (#34071)
This commit is contained in:
+1
-3
@@ -78,9 +78,7 @@ class Alert extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_destroyElement(element) {
|
_destroyElement(element) {
|
||||||
if (element.parentNode) {
|
element.remove()
|
||||||
element.parentNode.removeChild(element)
|
|
||||||
}
|
|
||||||
|
|
||||||
EventHandler.trigger(element, EVENT_CLOSED)
|
EventHandler.trigger(element, EVENT_CLOSED)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -98,11 +98,11 @@ class Popover extends Tooltip {
|
|||||||
this.tip = super.getTipElement()
|
this.tip = super.getTipElement()
|
||||||
|
|
||||||
if (!this.getTitle()) {
|
if (!this.getTitle()) {
|
||||||
this.tip.removeChild(SelectorEngine.findOne(SELECTOR_TITLE, this.tip))
|
SelectorEngine.findOne(SELECTOR_TITLE, this.tip).remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._getContent()) {
|
if (!this._getContent()) {
|
||||||
this.tip.removeChild(SelectorEngine.findOne(SELECTOR_CONTENT, this.tip))
|
SelectorEngine.findOne(SELECTOR_CONTENT, this.tip).remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.tip
|
return this.tip
|
||||||
|
|||||||
+4
-4
@@ -208,8 +208,8 @@ class Tooltip extends BaseComponent {
|
|||||||
|
|
||||||
EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler)
|
EventHandler.off(this._element.closest(`.${CLASS_NAME_MODAL}`), 'hide.bs.modal', this._hideModalHandler)
|
||||||
|
|
||||||
if (this.tip && this.tip.parentNode) {
|
if (this.tip) {
|
||||||
this.tip.parentNode.removeChild(this.tip)
|
this.tip.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._popper) {
|
if (this._popper) {
|
||||||
@@ -314,8 +314,8 @@ class Tooltip extends BaseComponent {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
|
if (this._hoverState !== HOVER_STATE_SHOW) {
|
||||||
tip.parentNode.removeChild(tip)
|
tip.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
this._cleanTipClass()
|
this._cleanTipClass()
|
||||||
|
|||||||
@@ -116,11 +116,7 @@ class Backdrop {
|
|||||||
|
|
||||||
EventHandler.off(this._element, EVENT_MOUSEDOWN)
|
EventHandler.off(this._element, EVENT_MOUSEDOWN)
|
||||||
|
|
||||||
const { parentNode } = this._getElement()
|
this._element.remove()
|
||||||
if (parentNode) {
|
|
||||||
parentNode.removeChild(this._element)
|
|
||||||
}
|
|
||||||
|
|
||||||
this._isAppended = false
|
this._isAppended = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
|
|||||||
const elName = el.nodeName.toLowerCase()
|
const elName = el.nodeName.toLowerCase()
|
||||||
|
|
||||||
if (!allowlistKeys.includes(elName)) {
|
if (!allowlistKeys.includes(elName)) {
|
||||||
el.parentNode.removeChild(el)
|
el.remove()
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user