FIX: Quote reply button not taking into scrolling offset.
This commit is contained in:
parent
2484b8eb91
commit
c6a6d6e1d6
|
@ -72,7 +72,9 @@ export default Ember.Controller.extend({
|
||||||
range.insertNode(markerElement);
|
range.insertNode(markerElement);
|
||||||
|
|
||||||
// retrieve the position of the marker
|
// retrieve the position of the marker
|
||||||
const markerOffset = $(markerElement).offset(),
|
const $markerElement = $(markerElement)
|
||||||
|
markerOffset = $markerElement.offset(),
|
||||||
|
parentScrollLeft = $markerElement.parent().scrollLeft(),
|
||||||
$quoteButton = $('.quote-button');
|
$quoteButton = $('.quote-button');
|
||||||
|
|
||||||
// remove the marker
|
// remove the marker
|
||||||
|
@ -88,6 +90,8 @@ export default Ember.Controller.extend({
|
||||||
let topOff = markerOffset.top;
|
let topOff = markerOffset.top;
|
||||||
let leftOff = markerOffset.left;
|
let leftOff = markerOffset.left;
|
||||||
|
|
||||||
|
if (parentScrollLeft > 0) leftOff += parentScrollLeft;
|
||||||
|
|
||||||
if (isMobileDevice || isIOS || isAndroid) {
|
if (isMobileDevice || isIOS || isAndroid) {
|
||||||
topOff = topOff + 20;
|
topOff = topOff + 20;
|
||||||
leftOff = Math.min(leftOff + 10, $(window).width() - $quoteButton.outerWidth());
|
leftOff = Math.min(leftOff + 10, $(window).width() - $quoteButton.outerWidth());
|
||||||
|
|
Loading…
Reference in New Issue