Merge branch 'make_jsFunc_for_journalP' of https://github.com/Rulingcom/orbit into make_jsFunc_for_journalP

* 'make_jsFunc_for_journalP' of https://github.com/Rulingcom/orbit:
  delete fixed
This commit is contained in:
Rueshyna 2012-11-23 13:22:46 +08:00
commit 274d4b5cff
2 changed files with 8 additions and 4 deletions

View File

@ -50,7 +50,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
return false; 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({ $.ajax({
url : $(this).attr("href"), url : $(this).attr("href"),
type : "get", type : "get",
@ -64,7 +64,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
}) })
return false; 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 delurl = $(this).attr("href");
var parent = $(this).parent(); var parent = $(this).parent();
o.confirm({ o.confirm({
@ -76,8 +76,11 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
$.ajax({ $.ajax({
url : delurl, url : delurl,
type : "DELETE", type : "DELETE",
success : function(){ success : function(data){
parent.slideOut(); 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 def destroy
@writing_journal = WritingJournal.find(params[:id]) @writing_journal = WritingJournal.find(params[:id])
@writing_journal.destroy @writing_journal.destroy
render :json => {success: true,msg: "Paper deleted successfully!"}
end end
def get_journals_json def get_journals_json