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;
})
$("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