Closed Bug 969248 Opened 12 years ago Closed 12 years ago

Visiting an anchor in a file reloads page

Categories

(Webtools Graveyard :: DXR, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: erik, Assigned: jamon)

Details

(Whiteboard: js easy)

Attachments

(1 file)

Clicking a line number in a file view causes the page to reload. More importantly, choosing Jump To Definition in a context menu (when the definition is in the same file) causes the page to jump to the right line, and *then* the page reloads, making for a lot of jumping around. We probably have an overzealous JS handler.
I suspect this might be due to my history change - we refresh on onpopstate which might be getting hit (though I kind of hope it wouldn't). Worth logging in onpopstate to find out.
Whiteboard: js → js easy
Sure enough, it's the popStateHandler.
Assignee: nobody → erik
I think this is ready to merge. However, I have only tested it with the sample application code that ships with dxr and with Firefox and Chromium on Linux. Thus, I can't exactly be sure it will work with a more representative corpus of source code.
Commits pushed to master at https://github.com/mozilla/dxr https://github.com/mozilla/dxr/commit/c8156c36e2e52251f5d1e5508874da0c0a633ba6 refs bug 969248: added event.state check to prevent #anchor link triggered window.location.reload calls https://github.com/mozilla/dxr/commit/dccd18423845358c69ad4dcb7976f93dcf058fc0 Merge fix for page reloading on anchor clicks. Fix bug 969248.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Thanks Jamon! (also hi!)
Assignee: erik → jamon
Commit pushed to master at https://github.com/mozilla/dxr https://github.com/mozilla/dxr/commit/abdbef4f695ea56592295624eba8ee14d038dc19 refs bugs 976213 and 969248: adding multi-select to file view, and stopping page reloads on #anchor clicks
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: