prompt for deletion
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<a asp-action="Delete" asp-controller="Note" asp-route-noteName="@Model.CurrentNote" class="btn-symbol btn-delete" title="Delete Note">✕</a>
|
<a asp-action="Delete" asp-controller="Note" asp-route-noteName="@Model.CurrentNote" id="delete-note" class="btn-symbol btn-delete" title="Delete Note">✕</a>
|
||||||
<form method="post" class="action-form" asp-action="Create" asp-controller="Note">
|
<form method="post" class="action-form" asp-action="Create" asp-controller="Note">
|
||||||
<input type="text" name="noteName" placeholder="Note name" />
|
<input type="text" name="noteName" placeholder="Note name" />
|
||||||
<button type="submit" class="btn-symbol btn-create" title="Create Note">💾</button>
|
<button type="submit" class="btn-symbol btn-create" title="Create Note">💾</button>
|
||||||
|
@@ -55,6 +55,13 @@ $(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// handle delete note with confirmation
|
||||||
|
$('#delete-note').click(function (e) {
|
||||||
|
if (!confirm('Are you sure you want to delete this note?')) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// update content upon sync save
|
// update content upon sync save
|
||||||
connection.on('updateNote', function (content) {
|
connection.on('updateNote', function (content) {
|
||||||
$textarea.val(content);
|
$textarea.val(content);
|
||||||
|
Reference in New Issue
Block a user