delete fixed

This commit is contained in:
Harry Bomrah 2012-11-23 13:22:01 +08:00
parent 8009c6aa34
commit 3933c048b0
2 changed files with 8 additions and 4 deletions

View File

@ -50,7 +50,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
return false;
})
$("div[container=true]").unbind("click").on("click",".journal_paper_edit",function(){
$("div[container=true]").unbind(".edit").on("click.edit",".journal_paper_edit",function(){
$.ajax({
url : $(this).attr("href"),
type : "get",
@ -64,7 +64,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
})
return false;
})
$("div[container=true]").unbind("click").on("click",".journal_paper_delete",function(){
$("div[container=true]").unbind(".delete").on("click.delete",".journal_paper_delete",function(){
var delurl = $(this).attr("href");
var parent = $(this).parent();
o.confirm({
@ -76,8 +76,11 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
$.ajax({
url : delurl,
type : "DELETE",
success : function(){
parent.slideOut();
success : function(data){
if(data.success){
parent.hide("slide",function(){parent.remove();});
o.notify(data.msg,"success");
}
}
})
}

View File

@ -83,6 +83,7 @@ class Desktop::JournalPagesController < ApplicationController
def destroy
@writing_journal = WritingJournal.find(params[:id])
@writing_journal.destroy
render :json => {success: true,msg: "Paper deleted successfully!"}
end
def get_journals_json