1.0.0 • Published 7 years ago

jsyg-undoredo v1.0.0

Weekly downloads
44
License
MIT
Repository
github
Last release
7 years ago

JSYG.UndoRedo

DOM Undo/Redo plugin for JSYG framework (or standalone with jQuery)

Demo

http://yannickbochatay.github.io/JSYG.UndoRedo/

Installation

npm install jsyg-undoredo

Example with webpack/babel

import UndoRedo from "jsyg-undoredo"
import $ from "jquery"

let container = $('#myContainer')
let undoRedo = new UndoRedo(container)

undoRedo.enable();

$('#button').on("click", () => {
   container.find("#myDiv").width( (i,width) => width + 50 )
   undoRedo.saveState()
})

$('#undoButton').on("click", () => undoRedo.undo() )

$('#redoButton').on("click", () => undoRedo.redo() )