mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix permissions_debug.html to use takes_parent/takes_child, refs #2530
The JavaScript was still referencing the old field names takes_database and takes_resource instead of the new takes_parent and takes_child. This caused the resource input fields to not show/hide properly when selecting different permission actions.
This commit is contained in:
parent
c652e92049
commit
653475edde
1 changed files with 3 additions and 3 deletions
|
|
@ -77,13 +77,13 @@ var resource1 = document.getElementById('resource_1');
|
|||
var resource2 = document.getElementById('resource_2');
|
||||
function updateResourceVisibility() {
|
||||
var permission = permissionSelect.value;
|
||||
var {takes_database, takes_resource} = permissions[permission];
|
||||
if (takes_database) {
|
||||
var {takes_parent, takes_child} = permissions[permission];
|
||||
if (takes_parent) {
|
||||
resource1.closest('p').style.display = 'block';
|
||||
} else {
|
||||
resource1.closest('p').style.display = 'none';
|
||||
}
|
||||
if (takes_resource) {
|
||||
if (takes_child) {
|
||||
resource2.closest('p').style.display = 'block';
|
||||
} else {
|
||||
resource2.closest('p').style.display = 'none';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue