Add delete button
This commit is contained in:
parent
220888a7c5
commit
ab637deb33
@ -12,4 +12,21 @@ export default Controller.extend({
|
||||
|
||||
queryParams: ['path'],
|
||||
|
||||
actions: {
|
||||
|
||||
deleteItem () {
|
||||
if (window.confirm('Sure?')) {
|
||||
this.get('storage.client')
|
||||
.remove(this.get('path')).then(() => {
|
||||
this.transitionToRoute('index', {
|
||||
queryParams: {
|
||||
path: this.get('currentDirPath')
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -68,6 +68,17 @@
|
||||
|
||||
> header {
|
||||
height: 4rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
nav.breadcrumb-nav {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
nav.actions {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
<header>
|
||||
{{breadcrumb-nav currentDirPath=currentDirPath}}
|
||||
<nav class="actions">
|
||||
<button class="delete" {{action "deleteItem"}}>delete</button>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="inspect-details">
|
||||
|
Loading…
x
Reference in New Issue
Block a user