9 Commits
Author SHA1 Message Date
Philip Peitsch 5b7cd7c543 Re-implement up/down movements caching the last caret X position
When navigating vi the up/down arrow keys, the user often wants to move
multiple lines in sequence (e.g., to visually place the caret in one of
the following lines). To stop the caret suddenly jumping to the left
side of the page when crossing an empty paragraph, the caret's X position
will be stored and re-used by subsequent up/down movement for up to 2s
after navigating by line.

Any other operations performed by the local user (e.g., cursor movement
to the left or right), or edit operations by collaborative users will
immediately clear the stored X position.
2014-07-23 02:17:20 +10:00
Philip Peitsch 767a1934f3 Ensure a caret doesn't receive any new events after destroy is invoked
Deleting the caret before calling ensures there is no way for any external
sources to get access to the soon-to-be destroyed caret.

As part of tracking this down, scheduled tasks will now throw an error
if an attempt is made to trigger the task (either delayed or immediate)
after the particular instance has been destroyed.

This then showed that functions bound to browser events swallow errors
quietly, so additional logging was added to the EventManager delegation
code to ensure errors generated when processing an event are logged.
2014-06-11 20:33:32 +10:00
Friedrich W. H. Kossebau 1e2a4a8323 Normalize license headers of the webodf.js source files
* remove @license tag (to prevent Closure compiler keeping the comment)
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released webodf.js
* separate license header by empty line from following content
2014-06-02 12:19:05 +02:00
Friedrich W. H. Kossebau fd020eee3f Use Error objects in callback passed to "destroy" methods
The currently plain undefined objects are not useful at all, because
the properties are undefined.
2014-04-11 13:53:10 +02:00
Philip Peitsch a4e08ba851 Schedule UI updates using requestAnimationFrame rather than setTimeout
Using requestAnimationFrame ensures the callback is executed prior to
the next redraw, eliminating undesirable & highly visible flickers for
UI updates.

Fixes issue #491.
2014-03-28 00:12:34 +11:00
Jos van den Oever ff3c396aa6 Add core.Destroyable interface.
Every class that has a destroy() method now implements this interface.
2014-02-11 12:42:41 +01:00
Philip Peitsch f4f84cd1b1 Fix scheduled task so it only fires ONCE per group of trigger requests 2013-11-30 00:00:36 +11:00
Jos van den Oever 9d5b061734 Whitespace cleanup. 2013-11-26 16:55:00 +01:00
Philip Peitsch eeac880f46 Improve mouse selection peformance by throttling shadow cursor redrawing
Drawing the cursor on every mouse move event badly impacts the responsiveness
of the application, because the move events buffer in the browser until
every single event is processed. By setting these on a background timer,
the cursor is updated asap, but is able to aggregate multiple move events
received in this time period.
2013-10-31 23:07:02 +11:00