Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Nov 16, 2020
1 parent bf9a482 commit 630e827
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions js/src/dropdown.js
Expand Up @@ -277,17 +277,20 @@ class Dropdown {
const parentDropdown = this._element.parentNode
let placement = PLACEMENT_BOTTOM

// Handle dropup
if (hasClass(parentDropdown, CLASS_NAME_DROPUP)) {
placement = hasClass(this._menu, CLASS_NAME_MENURIGHT) ?
PLACEMENT_TOPEND :
PLACEMENT_TOP
} else if (hasClass(parentDropdown, CLASS_NAME_DROPRIGHT)) {
placement = PLACEMENT_RIGHT
} else if (hasClass(parentDropdown, CLASS_NAME_DROPLEFT)) {
placement = PLACEMENT_LEFT
} else if (hasClass(this._menu, CLASS_NAME_MENURIGHT)) {
placement = PLACEMENT_BOTTOMEND
switch (parentDropdown) {
case hasClass(parentDropdown, CLASS_NAME_DROPUP):
placement = hasClass(this._menu, CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP
break
case hasClass(parentDropdown, CLASS_NAME_DROPRIGHT):
placement = PLACEMENT_RIGHT
break
case hasClass(parentDropdown, CLASS_NAME_DROPLEFT):
placement = PLACEMENT_LEFT
break
case hasClass(parentDropdown, CLASS_NAME_MENURIGHT):
placement = PLACEMENT_BOTTOMEND
break
default:
}

return placement
Expand Down

0 comments on commit 630e827

Please sign in to comment.