Fix change status of delete-button properly

parent 0f85e3b9
......@@ -215,7 +215,7 @@
(button (@ (class "btn blue darken-2 edit-buttons")
(onclick "edit_post(this)"))
"Edit")
(button (@ (id "delete-button")
(button (@ (id ,(string-append "delete-button-" oid))
(class "btn red accent-2 edit-buttons")
(onclick "delete_post(this)"))
"Delete"))))
......
......@@ -207,16 +207,17 @@ function setme(obj){
}
function delete_post(obj) {
let delete_button = $("#delete-button")[0];
delete_button.innerText = "Deleting...";
delete_button.disabled = true;
let children_nodes = obj.parentNode.parentNode.children;
setme(children_nodes);
let article_content = children_nodes[5].innerHTML;
let article_oid = children_nodes[6].innerText;
let article_title = children_nodes[0].innerText;
let delete_button = document.getElementById("delete-button-" + article_oid);
delete_button.innerText = "Deleting...";
delete_button.disabled = true;
$(document).ready(function () {
$.ajax({
type: "POST",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment