From d5efdf2665fc75baa7c2832be6467606cdbb537e Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 11 Nov 2008 11:40:26 -0800 Subject: [PATCH] Fixed a bug in IE in which clicking a link sometimes caused the browser window to scroll down and then immediately back up. --- NEWS | 3 +++ static/js/Editor.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index b5dd00b..6cd78d9 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ 1.5.6: * Added permalinks to blog and discussion forum posts. + * Fixed a bug in Internet Explorer in which clicking a link sometimes caused + the browser window to scroll to the destination note, only to immediately + scroll back to the clicked link. 1.5.5: November 6, 2008 * Improved speed of Luminotes Desktop by adding some database indices. This diff --git a/static/js/Editor.js b/static/js/Editor.js index 5686361..5a97fbf 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -241,6 +241,10 @@ Editor.prototype.highlight = function ( scroll ) { } } + // focusing the highlighted editor before scrolling to it prevents IE from deciding to + // automatically scroll back to the link immediately afterwards + this.focus(); + if ( scroll ) { // if the editor is already completely on-screen, then there's no need to scroll var viewport_position = getViewportPosition();