Skip to content

Basic undo and redo prototype implementation on Fabric.js

License

Notifications You must be signed in to change notification settings

JamalAPI/fabric-history

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fabric-history

Basic undo and redo prototype implementation on Fabric.js

Setup

npm i fabric-history

Node projects

import 'fabric-history';

Or html

<script src="https://raw.githubusercontent.com/lyzerk/fabric-history/master/index.js"></script>

Initialization of the plugin is important, it listening the actions by that event registrations. Don't call historyInit more than once. And don't forget to dispose it.

Example setup

var canvas = new fabric.Canvas('canvas');

// historyInit is registers the events
canvas.historyInit();

// historyDispose is un-register the events
canvas.historyDispose();

Usage

Following commands will undo and redo the canvas.

canvas.undo();

canvas.redo();

About

Basic undo and redo prototype implementation on Fabric.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%