},
Calendar:{
overview:function(){
- if(oc_cal_opendialog == 0){
- $("#dialog_holder").load(oc_webroot + "/apps/calendar/ajax/choosecalendar.php");
- oc_cal_opendialog = 1;
+ if($('#choosecalendar_dialog').dialog('isOpen') == true){
+ $('#choosecalendar_dialog').dialog('moveToTop');
}else{
- alert(t("calendar", "You can't open more than one dialog per site!"));
+ $('#dialog_holder').load(oc_webroot + '/apps/calendar/ajax/choosecalendar.php', function(){
+ $('#choosecalendar_dialog').dialog({
+ width : 600,
+ close : function(event, ui) {
+ $(this).dialog('destroy').remove();
+ }
+ });
+ });
}
},
activation:function(checkbox, calendarid)
//event vars
Calendar.UI.loadEvents();
-var oc_cal_opendialog = 0;
-
function validate_event_form(url){
var post = $( "#event_form" ).serialize();
$("#errorbox").html("");
</table>
<script type="text/javascript">
var totalurl = "<?php echo ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].OC::$WEBROOT.'/apps/calendar/caldav.php/calendars'; ?>";
- $( "#choosecalendar_dialog" ).dialog({
- width : 600,
- close : function() {
- oc_cal_opendialog = 0;
- var lastchild = document.getElementById("body-user").lastChild
- while(lastchild.id != "lightbox"){
- document.getElementById("body-user").removeChild(lastchild);
- lastchild = document.getElementById("body-user").lastChild;
- }
- }
- });
function showcaldavurl(username, calname){
document.getElementById("caldav_url").value = totalurl + "/" + username + "/" + calname;
document.getElementById("caldav_url").style.display = "block";