Add disabled state + tooltip on dev tools tabs (#16844)

This commit is contained in:
Shaunak Kashyap 2018-02-23 07:22:25 -08:00
parent a2cc5fa276
commit 0c7b75e9f7
2 changed files with 13 additions and 1 deletions

View file

@ -22,6 +22,12 @@ uiModules
controller() {
this.devTools = devToolsRegistry.inOrder;
this.currentPath = `#${$location.path()}`;
this.onClick = (item, $event) => {
if (item.disabled) {
$event.preventDefault();
}
};
}
};
});

View file

@ -15,8 +15,14 @@
aria-selected="{{kbnDevToolsApp.currentPath === item.url}}"
ng-repeat="item in kbnDevToolsApp.devTools"
class="euiTab"
ng-class="{'euiTab-isSelected': kbnDevToolsApp.currentPath === item.url}"
ng-class="{'euiTab-isSelected': kbnDevToolsApp.currentPath === item.url, 'euiTab-isDisabled': item.disabled}"
ng-disabled="item.disabled"
kbn-href="{{::item.url}}"
ng-click="kbnDevToolsApp.onClick(item, $event)"
tooltip="{{ item.tooltipContent }}"
tooltip-placement="bottom"
tooltip-popup-delay="0"
tooltip-append-to-body="1"
>
{{::item.display}}
</a>