Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Logic bug in reposition() #13

Open
natedub opened this issue Apr 22, 2010 · 0 comments
Open

Logic bug in reposition() #13

natedub opened this issue Apr 22, 2010 · 0 comments

Comments

@natedub
Copy link

natedub commented Apr 22, 2010

There's a small operator precedence problem in reposition() that causes the function to throw an error when this.target == null. The ternary operator in this statement:

coords = coords || (this.target && this.target.offsetHeight)
    ? this.target.getCoordinates(this.box.getOffsetParent())
    : {top: window.getScrollTop(), left: 0, width: 40, height: 40};

needs to be wrapped in parentheses:

coords = coords || ((this.target && this.target.offsetHeight)
    ? this.target.getCoordinates(this.box.getOffsetParent())
    : {top: window.getScrollTop(), left: 0, width: 40, height: 40});
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant