Fix being able to delete notes when post is note locked
This commit is contained in:
@@ -523,13 +523,15 @@ Danbooru.Note = {
|
|||||||
|
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var id = $this.data("id");
|
var id = $this.data("id");
|
||||||
Danbooru.Note.Box.find(id).remove();
|
|
||||||
Danbooru.Note.Body.find(id).remove();
|
|
||||||
$this.dialog("close");
|
|
||||||
|
|
||||||
if (id.match(/\d/)) {
|
if (id.match(/\d/)) {
|
||||||
$.ajax("/notes/" + id + ".js", {
|
$.ajax("/notes/" + id + ".json", {
|
||||||
type: "DELETE"
|
type: "DELETE",
|
||||||
|
success: function() {
|
||||||
|
Danbooru.Note.Box.find(id).remove();
|
||||||
|
Danbooru.Note.Body.find(id).remove();
|
||||||
|
$this.dialog("close");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class NotesController < ApplicationController
|
|||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@note = Note.find(params[:id])
|
@note = Note.find(params[:id])
|
||||||
@note.update_attribute(:is_active, false)
|
@note.update_attributes(:is_active => false)
|
||||||
respond_with(@note)
|
respond_with(@note)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user