Bug Tracker

Ticket #759 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Minor bug in getPosition method of Interface plugin.

Reported by: jeffkretz@… Assigned to: stefan
Type: bug Priority: minor
Milestone: Component: interface
Version: Keywords: getPosition
Cc: Needs:

Description

Part of the getPosition function walks up the DOM to the body element to get the scroll position of the page.

while (el && el.tagName.toLowerCase() != 'body')

I had a situation whereby a parent element had no tag, and this method threw an exception. I suggest this implementation which solves the issue:

while (el && el.tagName && el.tagName.toLowerCase() != 'body')

Attachments

Change History

Changed 2 years ago by brandon

Stefan, feel free to grab the .offset() method in the dimensions plugin and use it. It takes care of this issue and several others.

Changed 2 years ago by stefan

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.