Skip to content

Commit

Permalink
Delete confirmations. Closing #44
Browse files Browse the repository at this point in the history
  • Loading branch information
willosof committed Jun 5, 2018
1 parent 15eee24 commit 7c87b31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion public/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ $(function() {
$tr.append($options);

$del_td.click(function() {
socket.emit('bank_delAction', page, bank, $(this).parent().data('id'));
if (confirm('Delete action?')) {
socket.emit('bank_delAction', page, bank, $(this).parent().data('id'));
}
})
$tbody.append($tr);

Expand Down
12 changes: 7 additions & 5 deletions public/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ $(function() {
$td_actions.append($button_edit);

$button_delete.click(function() {
var id = $(this).data('id');
$("#instanceConfigTab").hide();
console.log("instance-delete:",id);
socket.emit('instance_delete', id);
$(this).parent().parent().remove();
if (confirm('Delete instance?')) {
var id = $(this).data('id');
$("#instanceConfigTab").hide();
console.log("instance-delete:",id);
socket.emit('instance_delete', id);
$(this).parent().parent().remove();
}
});

$button_edit.click(function() {
Expand Down

0 comments on commit 7c87b31

Please sign in to comment.