form for coauthor - fixed
This commit is contained in:
parent
8ab7245695
commit
56aa125ade
|
@ -322,7 +322,32 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
|
$("a.bt-co-author").click(function(){
|
||||||
|
$.ajax({
|
||||||
|
url : $(this).attr("href"),
|
||||||
|
type : "get",
|
||||||
|
success : function(data){
|
||||||
|
var prev_data = $("div[container=true]").html();
|
||||||
|
$("div[container=true]").html(data);
|
||||||
|
o.tinyscrollbar_ext({
|
||||||
|
main: '.tinycanvas',
|
||||||
|
fill: '.s_grid_con'
|
||||||
|
})
|
||||||
|
$(".bt-cancel").click(function(){
|
||||||
|
$("div[container=true]").html(prev_data);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return false;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
bindHandlers();
|
bindHandlers();
|
||||||
}
|
}
|
||||||
|
this.initializeJournalPapers.coauthorRelationForm = function(data){
|
||||||
|
if(data.success){
|
||||||
|
o.notify(data.msg,"success");
|
||||||
|
}else{
|
||||||
|
o.notify(data.msg,"alert");
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<%= form_for(@new_relation , url: desktop_co_author_relations_path ) do |f| %>
|
<%= form_for(@new_relation , url: desktop_co_author_relations_path, html:{"form-type"=>"ajax_form", "callback-method"=>"coauthorRelationForm"} ) do |f| %>
|
||||||
<%= f.text_field :relation %>
|
<%= f.text_field :relation %>
|
||||||
<%= f.submit "Save" %>
|
<%= f.submit "Save" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<h1>list all coauthor</h1>
|
<h1>list all coauthor</h1>
|
||||||
<%= link_to "New Co-Author", new_desktop_co_author_path %>
|
<%= link_to "New Co-Author", new_desktop_co_author_path, :class=>"bt-co-author" %>
|
||||||
<%= link_to "New Type", desktop_co_author_relations_path, :class=>"bt-new-type" %>
|
<%= link_to "New Type", desktop_co_author_relations_path, :class=>"bt-new-type" %>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Reference in New Issue