diff --git a/app/assets/javascripts/desktop/orbitdesktop.js b/app/assets/javascripts/desktop/orbitdesktop.js index b5a44940..e0613b29 100755 --- a/app/assets/javascripts/desktop/orbitdesktop.js +++ b/app/assets/javascripts/desktop/orbitdesktop.js @@ -289,13 +289,14 @@ var orbitDesktop = function(dom){ return false; } var ca = $e.attr("content-holder"); + var a = function(){ $.ajax({ type : t, dataType : responsetype, url : $e.attr("href"), success : function(data){ - if(typeof data == "string"){ + if(typeof data == "string" && t != "delete"){ if(ca) $(ca).html(data); else{ @@ -308,10 +309,12 @@ var orbitDesktop = function(dom){ window.o[o.data_method][exe](data,$e); if(t == "delete"){ 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(); } } + }, + error : function(x){ } }); } diff --git a/app/controllers/admin/import_data_controller.rb b/app/controllers/admin/import_data_controller.rb index 711cf40e..afe179aa 100644 --- a/app/controllers/admin/import_data_controller.rb +++ b/app/controllers/admin/import_data_controller.rb @@ -250,6 +250,7 @@ class Admin::ImportDataController < OrbitBackendController @journal_paper.create_user_id = hash.id @journal_paper.save! + end else puts "No journal paper by Teacher" diff --git a/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js b/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js index 3fee6f71..0ed0ea51 100644 --- a/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js +++ b/vendor/built_in_modules/personal_journal/app/assets/javascripts/personal_journal/desktop/journal_pages.js @@ -33,6 +33,7 @@ orbitDesktop.prototype.initializeJournalPapers = function(target,url,cache){ // } this.initializeJournalPapers.paperDelete = function(data,dom){ var parent = dom.parent().parent().parent(); + // console.log(parent); if(data.success){ parent.hide("slide",function(){parent.remove();}); o.notify(data.msg,"success"); diff --git a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb index 785cb0ca..2e95d1cd 100644 --- a/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb +++ b/vendor/built_in_modules/personal_journal/app/helpers/panel/personal_journal/desktop/journal_pages_helper.rb @@ -81,6 +81,7 @@ module Panel::PersonalJournal::Desktop::JournalPagesHelper "ajax-remote" => "delete", "confirm-message" => t("sure?"), "callback-method" => "paperDelete", + "response-type" => "json", "delete-item" => "true", :class => "journal_paper_delete admbg2 admtxt", :href => panel_personal_journal_desktop_journal_page_path(publication)) diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb index 41b7924a..5e68aa54 100644 --- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb +++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/desktop/journal_pages/index.html.erb @@ -59,7 +59,7 @@