diff options
author | Jacopo <beschi.jacopo@gmail.com> | 2019-03-22 20:05:56 +0300 |
---|---|---|
committer | Jacopo <beschi.jacopo@gmail.com> | 2019-03-22 23:50:03 +0300 |
commit | fa976454c1c998d3beee45b5663a96c2f609edbc (patch) | |
tree | 995f71c4f82fc2565b24c68e1e02ef50570473b6 /app/assets/javascripts | |
parent | b53376592491cf2016fe68fecaf5f090cf4627b4 (diff) |
Makes emoji picker full width on mobile
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/awards_handler.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index aeb88715c11..3826ecd1ac1 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -8,6 +8,7 @@ import { updateTooltipTitle } from './lib/utils/common_utils'; import { isInVueNoteablePage } from './lib/utils/dom_utils'; import flash from './flash'; import axios from './lib/utils/axios_utils'; +import bp from './breakpoints'; const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd'; const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd'; @@ -264,7 +265,10 @@ export class AwardsHandler { const css = { top: `${$addBtn.offset().top + $addBtn.outerHeight()}px`, }; - if (position === 'right') { + // for xs screen we position the element on center + if (bp.getBreakpointSize() === 'xs') { + css.left = '5%'; + } else if (position === 'right') { css.left = `${$addBtn.offset().left - $menu.outerWidth() + 20}px`; $menu.addClass('is-aligned-right'); } else { |