mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
Fix clickable being announced for all modelview text (#8384)
* Fix clickable being announced for all modelview text * Remove unused method * Move API changes into proposed
This commit is contained in:
@@ -10,12 +10,12 @@ import {
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
import { IComponent, IComponentDescriptor, IModelStore } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/workbench/browser/modelComponents/interfaces';
|
||||
import { TitledComponent } from 'sql/workbench/browser/modelComponents/titledComponent';
|
||||
|
||||
@Component({
|
||||
selector: 'modelview-hyperlink',
|
||||
template: `<a [href]="getUrl()" [title]="title" target="blank">{{getLabel()}}</a>`
|
||||
template: `<a [href]="getUrl()" [title]="title" target="blank" (click)="onClick()">{{getLabel()}}</a>`
|
||||
})
|
||||
export default class HyperlinkComponent extends TitledComponent implements IComponent, OnDestroy, AfterViewInit {
|
||||
@Input() descriptor: IComponentDescriptor;
|
||||
@@ -65,4 +65,14 @@ export default class HyperlinkComponent extends TitledComponent implements IComp
|
||||
public getUrl(): string {
|
||||
return this.url;
|
||||
}
|
||||
|
||||
public onClick(): boolean {
|
||||
this.fireEvent({
|
||||
eventType: ComponentEventType.onDidClick,
|
||||
args: undefined
|
||||
});
|
||||
// If we don't have a URL then return false since that just defaults to the URL for the workbench. We assume
|
||||
// if a blank url is specified then the caller is handling the click themselves.
|
||||
return !!this.url;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user