]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/js/event_edit.js
Photo to src
[friendica.git] / view / theme / frio / js / event_edit.js
index 2eec51916a8b3fab3a416568d018aabeb99b813d..da0837223a4af7754f4dc58a1d5937dab5334bad 100644 (file)
@@ -50,6 +50,24 @@ $(document).ready(function() {
                e.preventDefault();
        });
 
+       // Construct a new ACL. We need this everytime the 'event-edit-form' is loaded
+       // without page reloading (e.g. closing an old modal and open a new modal).
+       // Otherwise we wouldn't get the ACL data.
+       /// @todo: Try to implement some kind of ACL reloading in acl.js.
+       if (typeof acl !== "undefined") {
+               var eventPerms = document.getElementById('event-edit-form');
+
+               acl = new ACL(
+                       baseurl + "/acl",
+                       [
+                               eventPerms.dataset.allow_cid,
+                               eventPerms.dataset.allow_gid,
+                               eventPerms.dataset.deny_cid,
+                               eventPerms.dataset.deny_gid
+                       ]
+               );
+       }
+
 });
 
 // Load the html of the actual event and incect the output to the
@@ -63,19 +81,6 @@ function doEventPreview() {
 }
 
 
-// This function load the content of the edit url into a modal.
-function eventEdit(url) {
-       var char = qOrAmp(url);
-       url = url + char + 'mode=none';
-
-       $.get(url, function(data) {
-               $("#modal-body").empty();
-               $("#modal-body").append(data);
-       }).done(function() {
-               loadModalTitle();
-       });
-}
-
 // The following functions show/hide the specific event-edit content 
 // in dependence of the selected nav.
 function eventAclActive() {