Add delete button

This commit is contained in:
Basti 2017-12-30 20:24:40 +01:00
parent 220888a7c5
commit ab637deb33
3 changed files with 31 additions and 0 deletions

View File

@ -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')
}
});
});
}
}
}
});

View File

@ -68,6 +68,17 @@
> header {
height: 4rem;
display: flex;
flex-direction: row;
nav.breadcrumb-nav {
flex: 1;
}
nav.actions {
flex: 1;
text-align: right;
}
}
}
}

View File

@ -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">