added ability to revert (#21)

This commit is contained in:
undergroundwires
2020-07-15 19:04:56 +01:00
parent 57028987f1
commit 9c063d59de
58 changed files with 1448 additions and 265 deletions

View File

@@ -18,7 +18,7 @@
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import CardListItem from './CardListItem.vue';
import { StatefulVue, IApplicationState } from '@/presentation/StatefulVue';
import { StatefulVue } from '@/presentation/StatefulVue';
import { ICategory } from '@/domain/ICategory';
@Component({
@@ -32,7 +32,7 @@ export default class CardList extends StatefulVue {
public async mounted() {
const state = await this.getCurrentStateAsync();
this.setCategories(state.app.categories);
this.setCategories(state.app.actions);
this.onOutsideOfActiveCardClicked(() => {
this.activeCategoryId = null;
});
@@ -52,7 +52,7 @@ export default class CardList extends StatefulVue {
return;
}
const element = document.querySelector(`[data-category="${this.activeCategoryId}"]`);
if (!element.contains(event.target)) {
if (element && !element.contains(event.target)) {
callback();
}
};