0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-07 04:54:24 +01:00

dropdown.js: simplify code (#32055)

This commit is contained in:
XhmikosR 2020-11-03 16:43:20 +02:00 committed by GitHub
parent ccac6a6219
commit b864973a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -278,10 +278,9 @@ class Dropdown {
// Handle dropup // Handle dropup
if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
placement = PLACEMENT_TOP placement = this._menu.classList.contains(CLASS_NAME_MENURIGHT) ?
if (this._menu.classList.contains(CLASS_NAME_MENURIGHT)) { PLACEMENT_TOPEND :
placement = PLACEMENT_TOPEND PLACEMENT_TOP
}
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPRIGHT)) { } else if (parentDropdown.classList.contains(CLASS_NAME_DROPRIGHT)) {
placement = PLACEMENT_RIGHT placement = PLACEMENT_RIGHT
} else if (parentDropdown.classList.contains(CLASS_NAME_DROPLEFT)) { } else if (parentDropdown.classList.contains(CLASS_NAME_DROPLEFT)) {