Dropdown.js: return early (#2783)

pull/2788/head
XhmikosR 2020-06-03 19:05:36 +03:00 committed by GitHub
parent 312e083fc0
commit f091c5d510
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 18 deletions

View File

@ -58,7 +58,10 @@ class Dropdown {
fixPosition() { fixPosition() {
const $element = $(Selector.DROPDOWN_MENU_ACTIVE) const $element = $(Selector.DROPDOWN_MENU_ACTIVE)
if ($element.length !== 0) { if ($element.length === 0) {
return
}
if ($element.hasClass(ClassName.DROPDOWN_RIGHT)) { if ($element.hasClass(ClassName.DROPDOWN_RIGHT)) {
$element.css('left', 'inherit') $element.css('left', 'inherit')
$element.css('right', 0) $element.css('right', 0)
@ -79,7 +82,6 @@ class Dropdown {
$element.css('right', 0) $element.css('right', 0)
} }
} }
}
// Static // Static