added ability to revert (#21)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user