diff options
author | Bart Visscher <bartv@thisnet.nl> | 2011-09-16 14:11:22 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2011-09-16 14:11:22 +0200 |
commit | 73d3dc91fdcd106eedb73caa1f970b59f2814c71 (patch) | |
tree | e1b550c94127850df8287b7f6ae344617e2cccc0 | |
parent | 0fde26c86c0e9f7f6738f68b29d6e61a8d8c2ac6 (diff) | |
download | nextcloud-server-73d3dc91fdcd106eedb73caa1f970b59f2814c71.tar.gz nextcloud-server-73d3dc91fdcd106eedb73caa1f970b59f2814c71.zip |
Handle multi open of choosecalendar dialog
-rw-r--r-- | apps/calendar/js/calendar.js | 16 | ||||
-rw-r--r-- | apps/calendar/templates/part.choosecalendar.php | 11 |
2 files changed, 10 insertions, 17 deletions
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 31277b716be..d18a9573742 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -383,11 +383,17 @@ Calendar={ }, 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) @@ -802,8 +808,6 @@ $(document).ready(function(){ //event vars Calendar.UI.loadEvents(); -var oc_cal_opendialog = 0; - function validate_event_form(url){ var post = $( "#event_form" ).serialize(); $("#errorbox").html(""); diff --git a/apps/calendar/templates/part.choosecalendar.php b/apps/calendar/templates/part.choosecalendar.php index 4b4cff6f95e..c355907c995 100644 --- a/apps/calendar/templates/part.choosecalendar.php +++ b/apps/calendar/templates/part.choosecalendar.php @@ -23,17 +23,6 @@ for($i = 0; $i < count($option_calendars); $i++){ </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"; |