add function so you need to confirm clear whiteboard

This commit is contained in:
raphael 2019-02-11 14:09:21 +01:00
parent df21fa2314
commit c5b67edf18
2 changed files with 13 additions and 1 deletions

View File

@ -28,9 +28,12 @@
<!---Toolbar -!-->
<div style="position: absolute; top: 10px; left: 10px;">
<div class="btn-group">
<button id="whiteboardTrashBtn" title="Clears the whiteboard" type="button" class="whiteboardBtn">
<button id="whiteboardTrashBtn" title="Clear the whiteboard" type="button" class="whiteboardBtn">
<i class="fa fa-trash"></i>
</button>
<button style="position:absolute; left:0px; top:0px; width: 46px; display:none;" id="whiteboardTrashBtnConfirm" title="Confirm clear..." type="button" class="whiteboardBtn">
<i class="fa fa-check"></i>
</button>
<button id="whiteboardUndoBtn" title="Undo your last step" type="button" class="whiteboardBtn">
<i class="fa fa-undo"></i>
</button>

View File

@ -57,6 +57,15 @@ $(document).ready(function () {
// whiteboard clear button
$("#whiteboardTrashBtn").click(function () {
$("#whiteboardTrashBtnConfirm").show().focus();
});
$("#whiteboardTrashBtnConfirm").focusout(function() {
$(this).hide();
});
$("#whiteboardTrashBtnConfirm").click(function () {
$(this).hide();
whiteboard.clearWhiteboard();
});