mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2007] Info Drawer - currentTab event should return a key not the label (#2715)
* [ADF-2007] bug fix Info drawer will emit the current active tab instead of the tab label Also updated the test spec * Emit tab index on clicking
This commit is contained in:
committed by
Eugenio Romano
parent
eba4399d6c
commit
eba46e4e44
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, ContentChildren, EventEmitter, Input, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { MatTabChangeEvent } from '@angular/material';
|
||||
@Component({
|
||||
selector: 'adf-info-drawer-tab',
|
||||
template: '<ng-template><ng-content></ng-content></ng-template>'
|
||||
@@ -37,7 +38,7 @@ export class InfoDrawerComponent {
|
||||
title: string|null = null;
|
||||
|
||||
@Output()
|
||||
currentTab: EventEmitter<any> = new EventEmitter<any>();
|
||||
currentTab: EventEmitter<number> = new EventEmitter<number>();
|
||||
|
||||
@ContentChildren(InfoDrawerTabComponent)
|
||||
contentBlocks: QueryList<InfoDrawerTabComponent>;
|
||||
@@ -46,8 +47,7 @@ export class InfoDrawerComponent {
|
||||
return this.contentBlocks.length > 0;
|
||||
}
|
||||
|
||||
onTabChange(event: any) {
|
||||
const tab = event.tab;
|
||||
this.currentTab.emit(tab.textLabel);
|
||||
onTabChange(event: MatTabChangeEvent) {
|
||||
this.currentTab.emit(event.index);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user