UX: Improve quoting on iOS

Fixes quote usability on iOS when the button is near the right edge of the screen.
This commit is contained in:
Penar Musaraj 2019-10-23 10:44:47 -04:00
parent a7301c8671
commit 4fa1ef0945

View File

@ -107,10 +107,13 @@ export default Ember.Component.extend({
let left = markerOffset.left + Math.max(0, parentScrollLeft);
if (showAtEnd) {
top = top + 20;
const nearRightEdgeOfScreen =
$(window).width() - $quoteButton.outerWidth() < left + 10;
top = nearRightEdgeOfScreen ? top + 50 : top + 20;
left = Math.min(
left + 10,
$(window).width() - $quoteButton.outerWidth()
$(window).width() - $quoteButton.outerWidth() - 10
);
} else {
top = top - $quoteButton.outerHeight() - 5;