I put the following plugin together so that when I switched editing a
long tiddler, my scroll position would be roughly preserved, which was
really handy. However, I just upgraded from FF 3.6 to FF 8 (and Win XP
to Windows 7), and now the plugin is broken. Now when I edit the
tiddler (double click or ctrl-enter), it scrolls to the bottom. (FWIW
it works properly in IE 8).

Here's the code:


(function() { // closure to create local scope for backup

// backup original function
window.config.commands.editTiddler.handler_noScroll =
window.config.commands.editTiddler.handler;
// override original function
window.config.commands.editTiddler.handler = function(event,src,title)
{ // arguments correspond to original function signature
        // perform custom operations
        var scrollPositionJT = findScrollY();
        // invoke the original function
        config.commands.editTiddler.handler_noScroll(event,src,title);
          window.scrollTo(0,scrollPositionJT);
alert("hello!");
};
})();


You'll notice the superflous "Hello!" alert at the end. I put that in
just to make sure the script was running, and for some reason, that
fixed the problem! The window scrolls properly, and I get the alert.
Without the alert line commented out, the windows scrolls to the
bottom of the tiddler.

If anyone has any suggestions, I'd be grateful. I'm really an amateur
with the Javascript. Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to