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
1 changed files with 3 additions and 4 deletions

View File

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