fix selection state indicator on cards not showing up
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
import { Component, Prop, Watch, Emit } from 'vue-property-decorator';
|
import { Component, Prop, Watch, Emit } from 'vue-property-decorator';
|
||||||
import ScriptsTree from '@/presentation/Scripts/ScriptsTree/ScriptsTree.vue';
|
import ScriptsTree from '@/presentation/Scripts/ScriptsTree/ScriptsTree.vue';
|
||||||
import { StatefulVue } from '@/presentation/StatefulVue';
|
import { StatefulVue } from '@/presentation/StatefulVue';
|
||||||
|
import { IEventSubscription } from '@/infrastructure/Events/ISubscription';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@@ -49,8 +50,17 @@ export default class CardListItem extends StatefulVue {
|
|||||||
public isAnyChildSelected = false;
|
public isAnyChildSelected = false;
|
||||||
public areAllChildrenSelected = false;
|
public areAllChildrenSelected = false;
|
||||||
|
|
||||||
|
private selectionChangedListener: IEventSubscription;
|
||||||
|
|
||||||
public async mounted() {
|
public async mounted() {
|
||||||
this.updateStateAsync(this.categoryId);
|
this.updateStateAsync(this.categoryId);
|
||||||
|
const context = await this.getCurrentContextAsync();
|
||||||
|
this.selectionChangedListener = context.state.selection.changed.on(() => this.updateStateAsync(this.categoryId));
|
||||||
|
}
|
||||||
|
public destroyed() {
|
||||||
|
if (this.selectionChangedListener) {
|
||||||
|
this.selectionChangedListener.unsubscribe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@Emit('selected')
|
@Emit('selected')
|
||||||
public onSelected(isExpanded: boolean) {
|
public onSelected(isExpanded: boolean) {
|
||||||
|
|||||||
Reference in New Issue
Block a user