mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
support aria-expand for actions (#11869)
* support aria-expand for actions * update text
This commit is contained in:
@@ -218,8 +218,8 @@ export class AddFeatureTabAction extends Action {
|
||||
|
||||
export class CollapseWidgetAction extends Action {
|
||||
private static readonly ID = 'collapseWidget';
|
||||
private static readonly COLLPASE_LABEL = nls.localize('collapseWidget', "Collapse");
|
||||
private static readonly EXPAND_LABEL = nls.localize('expandWidget', "Expand");
|
||||
private static readonly COLLPASE_LABEL = nls.localize('collapseWidget', "Collapse Widget");
|
||||
private static readonly EXPAND_LABEL = nls.localize('expandWidget', "Expand Widget");
|
||||
private static readonly COLLAPSE_ICON = 'codicon-chevron-up';
|
||||
private static readonly EXPAND_ICON = 'codicon-chevron-down';
|
||||
|
||||
@@ -234,6 +234,7 @@ export class CollapseWidgetAction extends Action {
|
||||
collpasedState ? CollapseWidgetAction.EXPAND_LABEL : CollapseWidgetAction.COLLPASE_LABEL,
|
||||
collpasedState ? CollapseWidgetAction.EXPAND_ICON : CollapseWidgetAction.COLLAPSE_ICON
|
||||
);
|
||||
this.expanded = !this.collpasedState;
|
||||
}
|
||||
|
||||
run(): Promise<boolean> {
|
||||
@@ -251,8 +252,9 @@ export class CollapseWidgetAction extends Action {
|
||||
return;
|
||||
}
|
||||
this.collpasedState = collapsed;
|
||||
this._setClass(this.collpasedState ? CollapseWidgetAction.EXPAND_ICON : CollapseWidgetAction.COLLAPSE_ICON);
|
||||
this.class = this.collpasedState ? CollapseWidgetAction.EXPAND_ICON : CollapseWidgetAction.COLLAPSE_ICON;
|
||||
this.label = this.collpasedState ? CollapseWidgetAction.EXPAND_LABEL : CollapseWidgetAction.COLLPASE_LABEL;
|
||||
this.expanded = !this.collpasedState;
|
||||
}
|
||||
|
||||
public set state(collapsed: boolean) {
|
||||
|
||||
@@ -252,6 +252,7 @@ export class CollapseCellsAction extends ToggleableAction {
|
||||
shouldToggleTooltip: toggleTooltip,
|
||||
isOn: false
|
||||
});
|
||||
this.expanded = true;
|
||||
}
|
||||
|
||||
public get isCollapsed(): boolean {
|
||||
@@ -259,6 +260,7 @@ export class CollapseCellsAction extends ToggleableAction {
|
||||
}
|
||||
private setCollapsed(value: boolean) {
|
||||
this.toggle(value);
|
||||
this.expanded = !value;
|
||||
}
|
||||
|
||||
public async run(context: URI): Promise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user