This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ v0.*.* (Upcoming release)
2+ * Reset undostack when loadSnapshot is called
3+ * Store moving a shape with the SelectTool in undoStack
4+
15v0.5.0:
26 * Support for React 15 & 16
37 * Fix XSS vulnerabilities in text tool (interactive & SVG output)
Original file line number Diff line number Diff line change 8686 < a href ="javascript:void(0); " class ='tool ' id ="hide-lc "> Teardown</ a >
8787 < a href ="javascript:void(0); " class ='tool ' id ="show-lc "> Setup</ a >
8888 < a href ="javascript:void(0); " class ='tool ' id ="clear-lc "> Clear</ a >
89+ < a href ="javascript:void(0); " class ='tool ' id ="undo-lc "> Undo</ a >
90+ < a href ="javascript:void(0); " class ='tool ' id ="redo-lc "> Redo</ a >
8991 </ div >
9092
9193 < div class ="toolset ">
204206 lc . clear ( ) ;
205207 } ) ;
206208
209+ $ ( "#undo-lc" ) . click ( function ( ) {
210+ lc . undo ( ) ;
211+ } ) ;
212+
213+ $ ( "#redo-lc" ) . click ( function ( ) {
214+ lc . redo ( ) ;
215+ } ) ;
216+
207217 // Set up our own tools...
208218 tools = [
209219 {
Original file line number Diff line number Diff line change @@ -486,7 +486,11 @@ module.exports = class LiterallyCanvas
486486 @ setColor (k, snapshot .colors [k])
487487
488488 if snapshot .shapes
489+ # reset shapes
489490 @shapes = []
491+ # reset undostack aswell when loading a snapshot
492+ @undostack = []
493+
490494 for shapeRepr in snapshot .shapes
491495 shape = JSONToShape (shapeRepr)
492496 @ execute (new actions.AddShapeAction (this , shape)) if shape
You can’t perform that action at this time.
0 commit comments