Skip to content

Commit f12eb86

Browse files
SimeonCSimeonC
SimeonC
authored and
SimeonC
committed
fix(textAngular.popover): Add scroll top offset.
1 parent 30aa67f commit f12eb86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ textAngular.directive("textAngular", [
193193
scope.reflowPopover = function(_el){
194194
/* istanbul ignore if: catches only if near bottom of editor */
195195
if(scope.displayElements.text[0].offsetHeight - 51 > _el[0].offsetTop){
196-
scope.displayElements.popover.css('top', _el[0].offsetTop + _el[0].offsetHeight + 'px');
196+
scope.displayElements.popover.css('top', _el[0].offsetTop + _el[0].offsetHeight + scope.displayElements.scrollWindow[0].scrollTop + 'px');
197197
scope.displayElements.popover.removeClass('top').addClass('bottom');
198198
}else{
199-
scope.displayElements.popover.css('top', _el[0].offsetTop - 54 + 'px');
199+
scope.displayElements.popover.css('top', _el[0].offsetTop - 54 + scope.displayElements.scrollWindow[0].scrollTop + 'px');
200200
scope.displayElements.popover.removeClass('bottom').addClass('top');
201201
}
202202
var _maxLeft = scope.displayElements.text[0].offsetWidth - scope.displayElements.popover[0].offsetWidth;

0 commit comments

Comments
 (0)