wiki:UndoAPI

Undo API

by Megan Gardner

  • Why we’re doing this
    • Web apps don’t have access to system undo
      • Hidden content editable
      • Devices with no keyboards
  • UI screenshots for content editable
  • What we expect to gain
    • Usable Undo
    • Multiple Undo Stacks
  • API
    • UndoItem
      • undo
      • redo
      • label
    • UndoManager
      • item(n)
      • position
      • length
      • addItem()
      • undo()
      • redo()
    • Element Extension (multiple undo stacks)
      • undoManager
      • undoScope (set the undoScope, creates undoManger)
  • Undo Example

document.undoManager.addItem(new UndoItem({

label: “MyAction”, undo: () => {

undo the action

}, redo: () => {

redo the action

}, merged: true

}));

Last modified 5 years ago Last modified on Nov 1, 2019, 4:51:55 PM
Note: See TracWiki for help on using the wiki.