sync button added for desktop and also fixed a little bug..
This commit is contained in:
parent
2a83c6b51d
commit
b533b3f6ea
|
@ -289,13 +289,14 @@ var orbitDesktop = function(dom){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var ca = $e.attr("content-holder");
|
var ca = $e.attr("content-holder");
|
||||||
|
|
||||||
var a = function(){
|
var a = function(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : t,
|
type : t,
|
||||||
dataType : responsetype,
|
dataType : responsetype,
|
||||||
url : $e.attr("href"),
|
url : $e.attr("href"),
|
||||||
success : function(data){
|
success : function(data){
|
||||||
if(typeof data == "string"){
|
if(typeof data == "string" && t != "delete"){
|
||||||
if(ca)
|
if(ca)
|
||||||
$(ca).html(data);
|
$(ca).html(data);
|
||||||
else{
|
else{
|
||||||
|
@ -308,10 +309,12 @@ var orbitDesktop = function(dom){
|
||||||
window.o[o.data_method][exe](data,$e);
|
window.o[o.data_method][exe](data,$e);
|
||||||
if(t == "delete"){
|
if(t == "delete"){
|
||||||
if($e.attr("delete-item")=="true"){
|
if($e.attr("delete-item")=="true"){
|
||||||
var li_to_delete = $e.parentsUntil("li[item=true]").find("li[item=true]");
|
var li_to_delete = $e.parentsUntil("li[item=true]");
|
||||||
li_to_delete.slideUp();
|
li_to_delete.slideUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
error : function(x){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,6 +250,7 @@ class Admin::ImportDataController < OrbitBackendController
|
||||||
|
|
||||||
@journal_paper.create_user_id = hash.id
|
@journal_paper.create_user_id = hash.id
|
||||||
@journal_paper.save!
|
@journal_paper.save!
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts "No journal paper by Teacher"
|
puts "No journal paper by Teacher"
|
||||||
|
|
|
@ -33,6 +33,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ //
|
||||||
}
|
}
|
||||||
this.initializeJournalPapers.paperDelete = function(data,dom){
|
this.initializeJournalPapers.paperDelete = function(data,dom){
|
||||||
var parent = dom.parent().parent().parent();
|
var parent = dom.parent().parent().parent();
|
||||||
|
// console.log(parent);
|
||||||
if(data.success){
|
if(data.success){
|
||||||
parent.hide("slide",function(){parent.remove();});
|
parent.hide("slide",function(){parent.remove();});
|
||||||
o.notify(data.msg,"success");
|
o.notify(data.msg,"success");
|
||||||
|
|
|
@ -81,6 +81,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper
|
||||||
"ajax-remote" => "delete",
|
"ajax-remote" => "delete",
|
||||||
"confirm-message" => t("sure?"),
|
"confirm-message" => t("sure?"),
|
||||||
"callback-method" => "paperDelete",
|
"callback-method" => "paperDelete",
|
||||||
|
"response-type" => "json",
|
||||||
"delete-item" => "true",
|
"delete-item" => "true",
|
||||||
:class => "journal_paper_delete admbg2 admtxt",
|
:class => "journal_paper_delete admbg2 admtxt",
|
||||||
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
:href => panel_personal_journal_desktop_journal_page_path(publication))
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_journal_paper_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Books</a></div>
|
<div class="sdm_t hh1"><a href="<%= admin_import_data_sync_journal_paper_data_path(:user_id => @userid) %>" class="icons-cycle" ajax-remote="get" response-type="json" callback-method="syncComplete" > Sync Journal Papers</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="hh1 hp sdm">
|
<div class="hh1 hp sdm">
|
||||||
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
|
||||||
|
|
Reference in New Issue