Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
abaa000b
Commit
abaa000b
authored
3 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Fix tab indicator
parent
95f2612e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/client/components/main_layout/PerspectiveTabs.js
+35
-24
35 additions, 24 deletions
src/client/components/main_layout/PerspectiveTabs.js
with
35 additions
and
24 deletions
src/client/components/main_layout/PerspectiveTabs.js
+
35
−
24
View file @
abaa000b
import
React
from
'
react
'
import
PropTypes
from
'
prop-types
'
import
{
withStyles
}
from
'
@material-ui/core/styles
'
import
Grow
from
'
@material-ui/core/Grow
'
import
Tabs
from
'
@material-ui/core/Tabs
'
import
Tab
from
'
@material-ui/core/Tab
'
import
{
Link
}
from
'
react-router-dom
'
...
...
@@ -38,6 +39,12 @@ class PerspectiveTabs extends React.Component {
if
(
newPath
!==
oldPath
)
{
this
.
setState
({
value
:
this
.
pathnameToValue
(
newPath
)
})
}
// Fix tabs indicator not showing on first load
// https://stackoverflow.com/a/61205108
const
evt
=
document
.
createEvent
(
'
UIEvents
'
)
evt
.
initUIEvent
(
'
resize
'
,
true
,
false
,
window
,
0
)
window
.
dispatchEvent
(
evt
)
}
pathnameToValue
=
pathname
=>
{
...
...
@@ -62,30 +69,34 @@ class PerspectiveTabs extends React.Component {
const
scrollButtons
=
tabs
.
length
>
3
?
'
auto
'
:
'
on
'
return
(
<
Paper
className
=
{
classes
.
root
}
>
<
Tabs
value
=
{
this
.
state
.
value
}
onChange
=
{
this
.
handleChange
}
indicatorColor
=
'
secondary
'
textColor
=
'
secondary
'
variant
=
{
variant
}
scrollButtons
=
{
scrollButtons
}
>
{
tabs
.
map
(
tab
=>
<
Tab
classes
=
{{
root
:
classes
.
tabRoot
,
labelIcon
:
classes
.
tabLabelIcon
,
wrapper
:
classes
.
tabWrapper
}}
key
=
{
tab
.
id
}
icon
=
{
tab
.
icon
}
label
=
{
intl
.
get
(
`tabs.
${
tab
.
id
}
`
)}
component
=
{
Link
}
to
=
{
tab
.
id
}
wrapped
/>
)}
<
/Tabs
>
<
Grow
in
>
<
Tabs
value
=
{
this
.
state
.
value
}
onChange
=
{
this
.
handleChange
}
indicatorColor
=
'
secondary
'
textColor
=
'
secondary
'
variant
=
{
variant
}
scrollButtons
=
{
scrollButtons
}
>
{
tabs
.
map
(
tab
=>
<
Tab
classes
=
{{
root
:
classes
.
tabRoot
,
labelIcon
:
classes
.
tabLabelIcon
,
wrapper
:
classes
.
tabWrapper
}}
key
=
{
tab
.
id
}
icon
=
{
tab
.
icon
}
label
=
{
intl
.
get
(
`tabs.
${
tab
.
id
}
`
)}
component
=
{
Link
}
to
=
{
tab
.
id
}
wrapped
/>
)}
<
/Tabs
>
<
/Grow
>
<
/Paper
>
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment