]> git.mxchange.org Git - friendica.git/blobdiff - view/theme/frio/js/event_edit.js
Merge pull request #6589 from rabuzarus/20190204_-_show_forum_account_in_vcard
[friendica.git] / view / theme / frio / js / event_edit.js
index 2eec51916a8b3fab3a416568d018aabeb99b813d..628835a5f0ba1958f977cc9376526fae970ab35a 100644 (file)
@@ -1,7 +1,7 @@
 $(document).ready(function() {
        // Go to the permissions tab if the checkbox is checked.
        $('body').on("click", "#id_share", function() {
-               if ($('#id_share').is(':checked') && !( $('#id_share').attr("disabled"))) { 
+               if ($('#id_share').is(':checked') && !( $('#id_share').attr("disabled"))) {
                        $('#acl-wrapper').show();
                        $("a#event-perms-lnk").parent("li").show();
                        toggleEventNav("a#event-perms-lnk");
@@ -50,6 +50,23 @@ $(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.
+
+       var eventPerms = document.getElementById('event-edit-form');
+
+       acl = new ACL(
+               baseurl + "/acl",
+               [
+                       JSON.parse(eventPerms.dataset.allow_cid),
+                       JSON.parse(eventPerms.dataset.allow_gid),
+                       JSON.parse(eventPerms.dataset.deny_cid),
+                       JSON.parse(eventPerms.dataset.deny_gid)
+               ]
+       );
+       acl.get(0, 100);
 });
 
 // Load the html of the actual event and incect the output to the
@@ -63,20 +80,7 @@ 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 
+// The following functions show/hide the specific event-edit content
 // in dependence of the selected nav.
 function eventAclActive() {
        $("#event-edit-wrapper, #event-preview, #event-desc-wrapper").hide();