Skip to content

Commit

Permalink
Merge pull request #257 from newpanjing/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
newpanjing authored May 7, 2020
2 parents 7b45ec0 + 336b3d8 commit b966ca5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simpleui/static/admin/js/admin/DateTimeShortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,14 @@

// Recalculate the clockbox position
// is it left-to-right or right-to-left layout ?
if (getStyle(document.body, 'direction') !== 'rtl') {
if (getStyle(document.body, 'direction') !== 'rtl' && document.body.clientWidth - findPosX(cal_link) > 230) {
cal_box.style.left = findPosX(cal_link) + 17 + 'px';
} else {
// since style's width is in em, it'd be tough to calculate
// px value of it. let's use an estimated px for now
// TODO: IE returns wrong value for findPosX when in rtl mode
// (it returns as it was left aligned), needs to be fixed.
cal_box.style.left = findPosX(cal_link) - 180 + 'px';
cal_box.style.left = findPosX(cal_link) - 230 + 'px';
}
cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px';

Expand Down

0 comments on commit b966ca5

Please sign in to comment.