Skip to content

Commit

Permalink
Add "Reset history" button to API demo page
Browse files Browse the repository at this point in the history
[#183750971]
  • Loading branch information
pjanik committed Dec 2, 2022
1 parent 1d51f14 commit 9617602
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dist/examples/api-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h2>API examples:</h2>
<div>
<button id="pause-history">Pause history</button>
<button id="restart-history">Restart history</button>
<button id="reset-history">Reset history</button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
Expand Down Expand Up @@ -57,6 +58,12 @@ <h2>API examples:</h2>
parseSVG: true
});
var state = null;
$("#pause-history").on("click", function () {
drawingTool.pauseHistory();
});
$("#unpause-history").on("click", function () {
drawingTool.unpauseHistory();
});
$("#set-background").on("click", function () {
drawingTool.setBackgroundImage($("#background-src").val());
});
Expand Down Expand Up @@ -93,6 +100,9 @@ <h2>API examples:</h2>
$("#restart-history").on("click", function () {
drawingTool.unpauseHistory();
});
$("#reset-history").on("click", function () {
drawingTool.resetHistory();
});
</script>
</body>
</html>
10 changes: 10 additions & 0 deletions public/examples/api-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h2>API examples:</h2>
<div>
<button id="pause-history">Pause history</button>
<button id="restart-history">Restart history</button>
<button id="reset-history">Reset history</button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
Expand Down Expand Up @@ -57,6 +58,12 @@ <h2>API examples:</h2>
parseSVG: true
});
var state = null;
$("#pause-history").on("click", function () {
drawingTool.pauseHistory();
});
$("#unpause-history").on("click", function () {
drawingTool.unpauseHistory();
});
$("#set-background").on("click", function () {
drawingTool.setBackgroundImage($("#background-src").val());
});
Expand Down Expand Up @@ -93,6 +100,9 @@ <h2>API examples:</h2>
$("#restart-history").on("click", function () {
drawingTool.unpauseHistory();
});
$("#reset-history").on("click", function () {
drawingTool.resetHistory();
});
</script>
</body>
</html>

0 comments on commit 9617602

Please sign in to comment.