Only add row on button click

This commit is contained in:
Jake Barnby
2022-09-12 14:04:50 +12:00
parent 1a1f33ef57
commit f10914156f
2 changed files with 3 additions and 9 deletions
@@ -102,7 +102,7 @@ $escapedPermissions = \array_map(function ($perm) {
<tfoot>
<tr>
<td colspan="<?php \count($permissions) + 2 ?>">
<button type="button" class="margin-top-small reverse" @click="$dispatch('addrow<?php echo \strtolower($form); ?>')">Add</button>
<button type="button" class="margin-top-small reverse" @click="addPermission()">Add Role</button>
</td>
</tr>
</tfoot>
+2 -8
View File
@@ -32,15 +32,9 @@
this.permissions[index] = existing;
}
});
this.permissions.push({role: ''});
},
addPermission(formId, role, permissions) {
this.permissions.push({
role: '',
});
this.reset();
addPermission() {
this.permissions.push({ role: '' });
},
updatePermission(index) {
// Because the x-model does not update before the click event,