Skip to content

Fix scrolling to sonde on click #4

@darksidelemm

Description

@darksidelemm

For some reason when you click on a sonde, the code thats meant to calculate the offset to scroll to returns 0,0. Something to do with the elements offsetParent being null.

Listener on the balloon marker is set here: https://github.com/projecthorus/sondehub-tracker/blob/master/js/tracker.js#L1754

The scrollToElement function is here: https://github.com/projecthorus/sondehub-tracker/blob/master/js/iscroll.js#L823

The key point seems to be that when it calculates the offset, the elements parent is null, so it can't calculate the offset from the top of the page (which is needed to scroll). You can test this by using a JS console on the main tracker and running something like: $('.vehicle10').offset()
(maybe replace the vehicle number with something smaller if there aren't enough sondes on the map).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions