mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Quote reply button not taking into scrolling offset.
This commit is contained in:
parent
2484b8eb91
commit
c6a6d6e1d6
1 changed files with 5 additions and 1 deletions
|
@ -72,7 +72,9 @@ export default Ember.Controller.extend({
|
|||
range.insertNode(markerElement);
|
||||
|
||||
// retrieve the position of the marker
|
||||
const markerOffset = $(markerElement).offset(),
|
||||
const $markerElement = $(markerElement)
|
||||
markerOffset = $markerElement.offset(),
|
||||
parentScrollLeft = $markerElement.parent().scrollLeft(),
|
||||
$quoteButton = $('.quote-button');
|
||||
|
||||
// remove the marker
|
||||
|
@ -88,6 +90,8 @@ export default Ember.Controller.extend({
|
|||
let topOff = markerOffset.top;
|
||||
let leftOff = markerOffset.left;
|
||||
|
||||
if (parentScrollLeft > 0) leftOff += parentScrollLeft;
|
||||
|
||||
if (isMobileDevice || isIOS || isAndroid) {
|
||||
topOff = topOff + 20;
|
||||
leftOff = Math.min(leftOff + 10, $(window).width() - $quoteButton.outerWidth());
|
||||
|
|
Loading…
Reference in a new issue