]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Remove a couple of variables used once
authorXhmikosR <xhmikosr@gmail.com>
Wed, 10 Jun 2020 15:41:32 +0000 (18:41 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 17 Jun 2020 13:58:56 +0000 (16:58 +0300)
js/src/alert.js
js/src/collapse.js

index 03922e94c3a48bd634a3b507e1f5ec69d7ebc5b1..bc0edc6c0eb621dbe0fd69220976d8fc9e252037 100644 (file)
@@ -61,11 +61,7 @@ class Alert {
   // Public
 
   close(element) {
-    let rootElement = this._element
-    if (element) {
-      rootElement = this._getRootElement(element)
-    }
-
+    const rootElement = element ? this._getRootElement(element) : this._element
     const customEvent = this._triggerCloseEvent(rootElement)
 
     if (customEvent === null || customEvent.defaultPrevented) {
index 639369b017dfbcbe6b434ebdd855c47d63154bb6..be65529556b17eae70e3c21032f96f2f46b81e4c 100644 (file)
@@ -287,8 +287,7 @@ class Collapse {
   }
 
   _getDimension() {
-    const hasWidth = this._element.classList.contains(WIDTH)
-    return hasWidth ? WIDTH : HEIGHT
+    return this._element.classList.contains(WIDTH) ? WIDTH : HEIGHT
   }
 
   _getParent() {