Skip to content

Commit

Permalink
Fixes #81 - keep 'Remove' tab group option, even when 'Group by Day' …
Browse files Browse the repository at this point in the history
…is chosen
  • Loading branch information
briangonzalez committed May 30, 2017
1 parent 645bdc7 commit b616d93
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/component/tab-group-actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,31 @@
<div class="button-group actions">
<a @click="restore">Restore</a>
<a @click="newWindow">Restore in new</a>
<a @click="remove" class="remove" v-if="tabGroup.id">Remove</a>
<a @click="remove" class="remove">Remove</a>
</div>
</template>

<script>
import store from '../store/index.js'
import pluralize from 'pluralize'
export default {
props: [
'tabGroup'
],
methods: {
remove () {
store.dispatch('DELETE_TAB_GROUP', this.tabGroup)
const tabString = pluralize('tab', this.tabGroup.tabs.length, true)
const shouldRemove = confirm(`
This tab group contains ${tabString} – are you sure you want to delete it?`)
if (!shouldRemove) return
if (this.tabGroup.id) {
store.dispatch('DELETE_TAB_GROUP', this.tabGroup)
} else {
this.tabGroup.tabs.forEach(tab => store.dispatch('DELETE_TAB', tab))
}
},
restore () {
this.tabGroup.tabs.forEach(t => {
Expand Down

0 comments on commit b616d93

Please sign in to comment.