guardian / scribe

DEPRECATED: A rich text editor framework for the web platform
http://guardian.github.io/scribe/
Apache License 2.0
3.5k stars 245 forks source link

UndoManager and transaction documentation #485

Open mindplay-dk opened 8 years ago

mindplay-dk commented 8 years ago

Inline documentation for UndoManager transactions is more or less non-existent.

What exactly are the transaction objects?

It appears to be an overloaded version of DOMTransaction, e.g. with several custom properties, including scribe, content and previousItem.

And it doesn't look like the scribe property is being used? (the advanced undo plugin doesn't seem to use them either.)

Under some conditions, _lastItem gets initialized as a full instance of one of these overloaded DOMTransaction objects, and at other times, it's as simple as { content: '' }, which does appear to be valid, as all properties of DOMTransaction are optional, but with no doc-blocks and no comments, it's all very difficult to reason about.

Can you provide some pointers in this area?