Whenever you click on a line in the code browser, it highlights it and sets the URL target to #lNNN which moves the page around. That prevents me from double-click to select one word or triple-clicking to select one line, because the page moves. I think it'd be best to not move the page when you click on a line, that is unexpected. We'd still want the highlight and URL target to be set though...
You can't prevent the page from moving at least momentarily (enough to interfere with a double-click) when changing the URL target via
window.location
. On browsers that support it, you can usehistory.pushState()
orhistory.replaceState()
to do so, but it won't work in most versions of IE.I think the best option would be to delay the click handler to allow for the double-click to register before updating the URL target.
Closed #528.
je/42cc_5769
This works great in chrome, but unfortunately, firefox resets the selection after page move. We're implemented another approach - highlight line only if there was exactly one click. It works fine in both ff & chrome.