Skip to content
Snippets Groups Projects
Unverified Commit a17750df authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #9956 from kevgathuku/enable-outline

Add focus indicator to File Details tabs view
parents d6113990 4e1feb5c
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
' {{#if tabHeaders}}' + ' {{#if tabHeaders}}' +
' <ul class="tabHeaders">' + ' <ul class="tabHeaders">' +
' {{#each tabHeaders}}' + ' {{#each tabHeaders}}' +
' <li class="tabHeader" data-tabid="{{tabId}}" data-tabindex="{{tabIndex}}">' + ' <li class="tabHeader" data-tabid="{{tabId}}" tabindex="0">' +
' <a href="#">{{label}}</a>' + ' <a href="#" tabindex="-1">{{label}}</a>' +
' </li>' + ' </li>' +
' {{/each}}' + ' {{/each}}' +
' </ul>' + ' </ul>' +
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
events: { events: {
'click a.close': '_onClose', 'click a.close': '_onClose',
'click .tabHeaders .tabHeader': '_onClickTab' 'click .tabHeaders .tabHeader': '_onClickTab',
'keyup .tabHeaders .tabHeader': '_onKeyboardActivateTab'
}, },
/** /**
...@@ -99,6 +100,12 @@ ...@@ -99,6 +100,12 @@
this.selectTab(tabId); this.selectTab(tabId);
}, },
_onKeyboardActivateTab: function (event) {
if (event.key === " " || event.key === "Enter") {
this._onClickTab(event);
}
},
template: function(vars) { template: function(vars) {
if (!this._template) { if (!this._template) {
this._template = Handlebars.compile(TEMPLATE); this._template = Handlebars.compile(TEMPLATE);
...@@ -126,7 +133,6 @@ ...@@ -126,7 +133,6 @@
templateVars.tabHeaders = _.map(this._tabViews, function(tabView, i) { templateVars.tabHeaders = _.map(this._tabViews, function(tabView, i) {
return { return {
tabId: tabView.id, tabId: tabView.id,
tabIndex: i,
label: tabView.getLabel() label: tabView.getLabel()
}; };
}); });
......
...@@ -764,7 +764,7 @@ kbd { ...@@ -764,7 +764,7 @@ kbd {
margin: 15px; margin: 15px;
.tabHeader { .tabHeader {
float: left; float: left;
padding: 5px; padding: 12px;
cursor: pointer; cursor: pointer;
color: var(--color-text-lighter); color: var(--color-text-lighter);
margin-bottom: 1px; margin-bottom: 1px;
...@@ -774,21 +774,13 @@ kbd { ...@@ -774,21 +774,13 @@ kbd {
} }
&.selected { &.selected {
font-weight: 600; font-weight: 600;
border-bottom: 1px solid var(--color-border);
}
&:hover,
&:focus {
border-bottom: 1px solid var(--color-border);
} }
&.selected, &.selected,
&:hover &:hover,
&:focus { &:focus {
margin-bottom: 0px; margin-bottom: 0px;
color: var(--color-main-text); color: var(--color-main-text);
a { border-bottom: 1px solid var(--color-text-lighter);
margin-bottom: 0px;
color: var(--color-main-text);
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment