Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma-fe
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
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ilja
pleroma-fe
Commits
acf414e4
Commit
acf414e4
authored
6 years ago
by
HJ
Browse files
Options
Downloads
Patches
Plain Diff
changed the way tab-switcher works to avoid removing/adding nodes since that
seems to cause issues, instead hiding nodes with css.
parent
50562eb6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/tab_switcher/tab_switcher.jsx
+10
-9
10 additions, 9 deletions
src/components/tab_switcher/tab_switcher.jsx
src/components/tab_switcher/tab_switcher.scss
+5
-0
5 additions, 0 deletions
src/components/tab_switcher/tab_switcher.scss
with
15 additions
and
9 deletions
src/components/tab_switcher/tab_switcher.jsx
+
10
−
9
View file @
acf414e4
import
Vue
from
'
vue
'
// FIXME: This doesn't like v-if directly inside the tab's contents, breaks vue really bad
import
'
./tab_switcher.scss
'
export
default
Vue
.
component
(
'
tab-switcher
'
,
{
...
...
@@ -27,11 +25,14 @@ export default Vue.component('tab-switcher', {
}
return
(<
button
onClick
=
{
this
.
activateTab
(
index
)
}
class
=
{
classes
.
join
(
'
'
)
}
>
{
slot
.
data
.
attrs
.
label
}
</
button
>)
});
const
contents
=
(
<
div
>
{
this
.
$slots
.
default
.
filter
(
slot
=>
slot
.
data
)[
this
.
active
]
}
</
div
>
);
const
contents
=
this
.
$slots
.
default
.
filter
(
_
=>
_
.
data
).
map
((
slot
,
index
)
=>
{
const
active
=
index
===
this
.
active
return
(
<
div
class
=
{
active
?
'
active
'
:
'
hidden
'
}
>
{
slot
}
</
div
>
)
});
return
(
<
div
class
=
"tab-switcher"
>
<
div
class
=
"tabs"
>
...
...
@@ -40,7 +41,7 @@ export default Vue.component('tab-switcher', {
<
div
class
=
"contents"
>
{
contents
}
</
div
>
</
div
>
)
</
div
>
)
}
})
This diff is collapsed.
Click to expand it.
src/components/tab_switcher/tab_switcher.scss
+
5
−
0
View file @
acf414e4
@import
'../../_variables.scss'
;
.tab-switcher
{
.contents
{
.hidden
{
display
:
none
;
}
}
.tabs
{
display
:
flex
;
position
:
relative
;
...
...
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