diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2018-08-31 14:57:05 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2018-09-03 16:30:03 +0200 |
| commit | 61b771256caad64815011a4eb5b68fe7f220f34e (patch) | |
| tree | 67c64fecfd3625caafad5a498dbc5d8e5069a718 /addons/web/static/src/js/views/basic/basic_renderer.js | |
| parent | 793988c7ed99b1b6e9a73efb94e438c7d0c7b34e (diff) | |
[FIX] web_editor: back to first -> history stay ok
If we do:
- one change that will be saved in history
- go back to the document before any change
- do other change
we can easily get in a state were the history is no longer recorded.
The history is kept like this:
- pos: our position in the history
- aUndo: the snapshots of history
- toSnap: the last history snapshop that is to be saved
so for example if we start without change (at originalState):
{pos: 0, aUndo=[], toSnap=null}
Then we do two changes (change1, change2):
{pos: 2, aUndo=[originalState, change1], toSnap=change2}
If we make an undo, we will get to:
{pos: 1, aUndo=[originalState,change1,change2], toSnap=null)
If we make another change (change3):
{pos: 2, aUndo=[originalState, change1], toSnap=change3}
So the history after the position is removed.
But when we get back to the original, the state would forever be:
{pos: 0, aUndo=[originalState], toSnap=change85}
because when doing a change, the code only removed history from the
max(pos, 1) index.
opw-1870119
closes #26701
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
0 files changed, 0 insertions, 0 deletions
