Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI Framework] Add kuiLocalTab-isDisabled state. #10830

Merged
merged 2 commits into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/management/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
ng-if="sectionName"
ng-repeat="item in section.visibleItems"
class="kuiLocalTab"
ng-class="{ 'kuiLocalTab-isSelected': item.active, 'kuiLocalTab-disabled': item.disabled || !item.url }"
ng-class="{ 'kuiLocalTab-isSelected': item.active, 'kuiLocalTab-isDisabled': !item.active && (item.disabled || !item.url) }"
kbn-href="{{::item.disabled ? '' : item.url}}"
data-test-subj="{{::item.name}}"
tooltip="{{::item.tooltip}}"
Expand Down
13 changes: 11 additions & 2 deletions ui_framework/components/local_nav/_local_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
text-decoration: none;
cursor: pointer;

&:hover,
&:active {
&:hover:not(.kuiLocalTab-isDisabled),
&:active:not(.kuiLocalTab-isDisabled) {
color: $localTabTextColor-isHover;

@include darkTheme {
Expand All @@ -39,6 +39,15 @@
}
}

/**
* 1. We may want to show a tooltip to explain why the tab is disabled, so we will just show
* a regular cursor instead of setting pointer-events: none.
*/
&.kuiLocalTab-isDisabled {
opacity: 0.5;
cursor: default; /* 1 */
}

& + & {
margin-left: 15px;
}
Expand Down
14 changes: 11 additions & 3 deletions ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -1258,10 +1258,14 @@ body {
color: #5a5a5a;
border-bottom: 2px solid transparent;
text-decoration: none;
cursor: pointer; }
.kuiLocalTab:hover, .kuiLocalTab:active {
cursor: pointer;
/**
* 1. We may want to show a tooltip to explain why the tab is disabled, so we will just show
* a regular cursor instead of setting pointer-events: none.
*/ }
.kuiLocalTab:hover:not(.kuiLocalTab-isDisabled), .kuiLocalTab:active:not(.kuiLocalTab-isDisabled) {
color: #000000; }
.theme-dark .kuiLocalTab:hover, .theme-dark .kuiLocalTab:active {
.theme-dark .kuiLocalTab:hover:not(.kuiLocalTab-isDisabled), .theme-dark .kuiLocalTab:active:not(.kuiLocalTab-isDisabled) {
color: #ffffff; }
.kuiLocalTab.kuiLocalTab-isSelected {
color: #000000;
Expand All @@ -1270,6 +1274,10 @@ body {
.theme-dark .kuiLocalTab.kuiLocalTab-isSelected {
color: #ffffff;
border-bottom-color: #ffffff; }
.kuiLocalTab.kuiLocalTab-isDisabled {
opacity: 0.5;
cursor: default;
/* 1 */ }
.kuiLocalTab + .kuiLocalTab {
margin-left: 15px; }
.theme-dark .kuiLocalTab {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Your Documents
</a>

<a class="kuiLocalTab" href="#">
<a class="kuiLocalTab kuiLocalTab-isDisabled" href="#">
Another Tab
</a>
</div>
Expand Down