First commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
|
||||
import button from "/elements/button.js";
|
||||
|
||||
import groups from '/user/group/user.group.permission.js';
|
||||
|
||||
export default class deleteButton extends button {
|
||||
|
||||
text = "Delete";
|
||||
|
||||
propegateEvent = false;
|
||||
|
||||
|
||||
async click() {
|
||||
|
||||
var sure = confirm("Are you sure you want to delete this item");
|
||||
|
||||
if( sure ) {
|
||||
|
||||
await this.parent.parent.delete();
|
||||
|
||||
this.parent.parent.remove();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
permission() {
|
||||
|
||||
this.allow( groups.admin, "DELETE" );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user