Skip to content

Commit

Permalink
Fix loading of permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty committed Aug 16, 2023
1 parent ed9f8e7 commit be23120
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions esp/public/media/scripts/custom_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,19 @@ var rebuild=function(metadata) {
$j(".section:empty").parent('.outline').remove();
// Reset add field form
$j("#cat_selector").val('Generic').trigger("change");
// Set up permissions if needed
if(metadata['perms']!=""){
clearPermsArea();
var meta_perms = metadata['perms'].split(",");
$j('#id_main_perm').val(meta_perms[0]).change();
if(meta_perms.length >= 2){
$j('#id_prog_belong').prop('checked', true).change();
$j('#id_perm_program').val(meta_perms[1]).change();
if(meta_perms.length == 3){
$j('#id_sub_perm').val(meta_perms[2]).change();
}
}
}
//Open the information panel if not already open
$j("#header_information.ui-accordion-header-collapsed").trigger("click");
};
Expand Down

0 comments on commit be23120

Please sign in to comment.