Skip to content

Commit

Permalink
Issue #2981: right aligned dropdowns possible (#2980)
Browse files Browse the repository at this point in the history
added class and functionality for right aligned dropdowns
  • Loading branch information
chzauleck authored Feb 19, 2024
1 parent 56a2dde commit be15dbc
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions var/httpd/htdocs/js/Core.UI.InputFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -1586,14 +1586,26 @@ Core.UI.InputFields = (function (TargetNS) {
// calculate available height to top of page
AvailableHeightTop = parseInt($InputContainerObj.offset().top - $(window).scrollTop() - Config.SafeMargin, 10);

// set left position
$ListContainerObj
.css({
left: $InputContainerObj.offset().left
});
if ( Config.CustomerInterface === true ) {
if ($SelectObj.hasClass('AlignDropdownRight')) {
// set right position
$ListContainerObj
.css('margin-left', '16px');
.css({
right: window.innerWidth-($InputContainerObj.offset().left + $InputContainerObj.outerWidth())
});
if ( Config.CustomerInterface === true ) {
$ListContainerObj
.css('margin-right', '16px');
}
} else {
// set left position
$ListContainerObj
.css({
left: $InputContainerObj.offset().left
});
if ( Config.CustomerInterface === true ) {
$ListContainerObj
.css('margin-left', '16px');
}
}

// decide whether list should be positioned on top or at the bottom of the input field
Expand Down

0 comments on commit be15dbc

Please sign in to comment.