From 33b660857a5ed9a939de97d6187e07c6e5a92486 Mon Sep 17 00:00:00 2001
From: Georg Ehrke <georg.stefan.germany@googlemail.com>
Date: Tue, 4 Oct 2011 10:17:11 +0200
Subject: [PATCH] fix ical import

---
 apps/calendar/templates/part.import.php | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/apps/calendar/templates/part.import.php b/apps/calendar/templates/part.import.php
index c1beb49a7f..3749367437 100644
--- a/apps/calendar/templates/part.import.php
+++ b/apps/calendar/templates/part.import.php
@@ -58,13 +58,18 @@ function importcal(importtype){
 	var file = $("#filename").val();
 	if(importtype == "existing"){
 		var calid = $("input:radio[name='calendar']:checked").val();
-		$.getJSON(OC.filePath('calendar', '', 'import.php') + "?import=existing&calid=" + calid + "&path=" + path + "&file=" + file);
+		$.getJSON(OC.filePath('calendar', '', 'import.php') + "?import=existing&calid=" + calid + "&path=" + path + "&file=" + file, function(){
+			$("#importdialog").dialog('destroy').remove();
+			$("#importdialogholder").remove();
+		});
 	}
 	if(importtype == "new"){
 		var calname = $("#displayname").val();
 		var description = $("#description").val();
-		$.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file});
+		$.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file}, function(){
+			$("#importdialog").dialog('destroy').remove();
+			$("#importdialogholder").remove();
+		});
 	}
-	window.location = oc_webroot + "/apps/calendar/";
 }
 </script>
\ No newline at end of file
-- 
GitLab