memento

memento

Memento plugin constructor for Sketchable instances.

Source:

Methods

(static) redo() → {Sketchable}

Goes forward to the previous CANVAS state, if available.

Source:
Returns:
Type:
Sketchable

Sketchable instance.

Example
sketchableInstance.memento.redo();

(static) restore(state) → {Sketchable}

Restore a CANVAS state.

Source:
Parameters:
Name Type Description
state object

State data.

Name Type Description
image string

Base64 image.

strokes array

Associated strokes.

Returns:
Type:
Sketchable

Sketchable instance.

Example
var someState = sketchableInstance.memento.state();
sketchableInstance.memento.restore(someState);

(static) save() → {Sketchable}

Save a snapshot of the current CANVAS.

Source:
Returns:
Type:
Sketchable

Sketchable instance.

Example
sketchableInstance.memento.save();

(static) state() → {object}

Read current CANVAS state: { image:String, strokes:Array }.

Source:
Returns:
Type:
object
Example
var state = sketchableInstance.memento.state();

(static) undo() → {Sketchable}

Goes back to the previous CANVAS state, if available.

Source:
Returns:
Type:
Sketchable

Sketchable instance.

Example
sketchableInstance.memento.undo();