79301818

Date: 2024-12-22 22:14:07
Score: 1.5
Natty:
Report link

Using my library undo.js, you can disable undo and redo actions (not just from shortcuts) using the following code:

undo.observe(document.body, {
    preventDefault:true
});

You can then capture requests from the user for undo and redo actions (using a shortcut or the browser menu) using:

myeditor.addEventListener("undo", function(e){
    // whatever...
});
myeditor.addEventListener("redo", function(e){
    // whatever...
});
Reasons:
  • Contains signature (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: JDMCreator