Skip to content

Commit

Permalink
popup_target_anchor: Change calc logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gela committed Jun 20, 2017
1 parent d600f24 commit 502e947
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions common.blocks/popup/_target/popup_target_anchor.js
Expand Up @@ -144,14 +144,14 @@ provide(Popup.declMod({ modName : 'target', modVal : 'anchor' }, /** @lends popu
anchorRight = anchorLeft + anchor.outerWidth(),
anchorBottom = anchorTop + anchor.outerHeight(),
direction = this.getMod('direction'),
vertBorder = Math.floor(this._checkMainDirection(direction, 'top') ||
vertBorder = this._checkMainDirection(direction, 'top') ||
this._checkSecondaryDirection(direction, 'top')?
anchorTop :
anchorBottom),
horizBorder = Math.floor(this._checkMainDirection(direction, 'left') ||
anchorBottom,
horizBorder = this._checkMainDirection(direction, 'left') ||
this._checkSecondaryDirection(direction, 'left')?
anchorLeft :
anchorRight),
anchorRight,
res = true;

this._anchorParents.each(function() {
Expand All @@ -167,14 +167,14 @@ provide(Popup.declMod({ modName : 'target', modVal : 'anchor' }, /** @lends popu
var parentOffset = parent.offset();

if(checkOverflowY) {
var parentTopOffset = Math.floor(parentOffset.top);
var parentTopOffset = parentOffset.top;
if(vertBorder < parentTopOffset || parentTopOffset + parent.outerHeight() < vertBorder) {
return res = false;
}
}

if(checkOverflowX) {
var parentLeftOffset = Math.floor(parentOffset.left);
var parentLeftOffset = parentOffset.left;
return res = !(
horizBorder < parentLeftOffset ||
parentLeftOffset + parent.outerWidth() < horizBorder);
Expand Down

0 comments on commit 502e947

Please sign in to comment.