Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Knowledge Space WP Plugin
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
Service Desk
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
alg
Knowledge Space WP Plugin
Commits
ad58a3b6
Commit
ad58a3b6
authored
3 years ago
by
Harm Kube
Browse files
Options
Downloads
Patches
Plain Diff
First structure for the new menu
parent
7f535905
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#52852
passed
3 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
display/display.css
+26
-0
26 additions, 0 deletions
display/display.css
display/overlays/neighbors.js
+36
-86
36 additions, 86 deletions
display/overlays/neighbors.js
with
62 additions
and
86 deletions
display/display.css
+
26
−
0
View file @
ad58a3b6
...
...
@@ -274,3 +274,29 @@
line-height
:
35px
;
font-size
:
0.7vw
;
}
.collapsible
{
background-color
:
#eee
;
color
:
#444
;
cursor
:
pointer
;
padding
:
18px
;
width
:
100%
;
border
:
none
;
text-align
:
left
;
outline
:
none
;
font-size
:
15px
;
display
:
flex
;
flex-direction
:
column
;
}
.active
,
.collapsible
:hover
{
background-color
:
#ccc
;
}
.content
{
padding
:
0
18px
;
display
:
none
;
overflow
:
hidden
;
background-color
:
#f1f1f1
;
flex-direction
:
column
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
display/overlays/neighbors.js
+
36
−
86
View file @
ad58a3b6
...
...
@@ -31,100 +31,48 @@ class NodeNeighborOverlay {
"
bottom-container
"
,
this
.
parentNode
);
const
bottomContainerNavDiv
=
Helpers
.
createDiv
(
"
b
o
tto
m-container-nav
"
,
const
coll
=
Helpers
.
createDiv
(
"
b
u
tto
n
"
,
bottomContainerDiv
);
const
bottomContainerLinkDiv
=
Helpers
.
createDiv
(
"
bottom-container-links
"
,
coll
.
className
=
"
collapsible
"
;
coll
.
innerText
=
"
Nachbarn
"
;
var
contentTabs
=
Helpers
.
createDiv
(
"
content
"
,
bottomContainerDiv
);
coll
.
addEventListener
(
"
click
"
,
function
()
{
if
(
contentTabs
.
style
.
display
===
"
flex
"
)
{
contentTabs
.
style
.
display
=
"
none
"
;
}
else
{
contentTabs
.
style
.
display
=
"
flex
"
;
}
});
const
colors
=
this
.
type
===
"
link
"
?
this
.
graph
.
edgeColors
:
this
.
graph
.
nodeColors
;
for
(
const
[
cls
,
color
]
of
Object
.
entries
(
colors
))
{
const
nav
Tab
=
Helpers
.
createDiv
(
"
b
o
tto
m-container-nav-tab
"
,
bottomContainerNavDiv
const
coll
Tab
=
Helpers
.
createDiv
(
"
b
u
tto
n
"
,
contentTabs
);
navTab
.
innerText
=
cls
.
slice
(
0
,
3
);
navTab
.
style
.
backgroundColor
=
color
;
navTab
.
type
=
cls
;
// Attach the edge type to the DOM object to retrieve it during click events
jQuery
(
navTab
).
click
((
event
)
=>
this
.
openTabFromEvent
(
event
));
this
.
tabNavHandles
[
cls
]
=
navTab
;
const
tabContent
=
Helpers
.
createDiv
(
"
bottom-container-tab-content
"
,
bottomContainerLinkDiv
collTab
.
className
=
"
collapsible
"
;
collTab
.
innerText
=
cls
;
collTab
.
style
.
backgroundColor
=
color
;
collTab
.
type
=
cls
;
const
collTabContent
=
Helpers
.
createDiv
(
"
content
"
,
contentTabs
);
tabContent
.
style
.
backgroundColor
=
color
;
this
.
tabContentPages
[
cls
]
=
tabContent
;
}
this
.
initializeActive
(
bottomContainerNavDiv
,
bottomContainerLinkDiv
);
}
/**
* Initializes the activeTabNav and activeTabContent variables to a random edge type.
* @param {Element} bottomContainerNavDiv
* @param {Element} bottomContainerLinkDiv
*/
initializeActive
(
bottomContainerNavDiv
,
bottomContainerLinkDiv
)
{
this
.
activeTabNav
=
bottomContainerNavDiv
.
firstChild
;
this
.
activeTabContent
=
bottomContainerLinkDiv
.
firstChild
;
this
.
activeTabContent
.
classList
.
add
(
"
active-tab-content
"
);
this
.
activeTabNav
.
classList
.
add
(
"
active-tab-nav
"
);
this
.
activeTabNav
.
innerText
=
this
.
activeTabNav
.
type
;
}
/**
* Click event handler for the tab headers of the bottom menu.
* @param event
*/
openTabFromEvent
(
event
)
{
const
navTab
=
event
.
target
;
const
cls
=
navTab
.
type
;
this
.
openTab
(
cls
);
}
openTab
(
cls
)
{
this
.
activeTabNav
.
classList
.
remove
(
"
active-tab-nav
"
);
this
.
activeTabNav
.
innerText
=
this
.
activeTabNav
.
innerText
.
slice
(
0
,
3
);
this
.
tabNavHandles
[
cls
].
classList
.
add
(
"
active-tab-nav
"
);
this
.
tabNavHandles
[
cls
].
innerText
=
cls
;
this
.
activeTabContent
.
classList
.
remove
(
"
active-tab-content
"
);
this
.
tabContentPages
[
cls
].
classList
.
add
(
"
active-tab-content
"
);
this
.
activeTabNav
=
this
.
tabNavHandles
[
cls
];
this
.
activeTabContent
=
this
.
tabContentPages
[
cls
];
}
toggleTabVisibility
(
cls
)
{
this
.
tabNavHandles
[
cls
].
classList
.
toggle
(
"
bottom-container-nav-tab
"
);
this
.
tabNavHandles
[
cls
].
classList
.
toggle
(
"
hidden-tab
"
);
const
tcc
=
this
.
tabContentPages
[
cls
].
classList
;
tcc
.
toggle
(
"
bottom-container-tab-content
"
);
tcc
.
toggle
(
"
hidden-tab
"
);
// If the tab gets hidden and is the active tab, search for an alternative nav tab to become the new active tab.
if
(
tcc
.
contains
(
"
hidden-tab
"
))
{
if
(
tcc
.
contains
(
"
active-tab-nav
"
))
{
for
(
const
tab
of
Object
.
values
(
this
.
tabNavHandles
))
{
if
(
!
tab
.
classList
.
contains
(
"
hidden-tab
"
))
{
this
.
openTab
(
tab
.
type
);
break
;
}
collTabContent
.
innerText
=
"
Example Text
"
;
collTab
.
addEventListener
(
"
click
"
,
function
()
{
if
(
collTabContent
.
style
.
display
===
"
flex
"
)
{
collTabContent
.
style
.
display
=
"
none
"
;
}
else
{
collTabContent
.
style
.
display
=
"
flex
"
;
}
}
}
else
{
// If all tabs are hidden, the new tab should become the active tab.
if
(
this
.
activeTabNav
.
classList
.
contains
(
"
hidden-tab
"
))
{
this
.
openTab
(
cls
);
}
});
}
}
...
...
@@ -132,9 +80,10 @@ class NodeNeighborOverlay {
* Clears the images from all tab content pages.
*/
clearTabContentPages
()
{
for
(
const
page
of
Object
.
values
(
this
.
tabContentPages
))
{
//TODO: Clear all content of content containers
/*for (const page of Object.values(this.tabContentPages)) {
jQuery(page).empty();
}
}
*/
}
/**
...
...
@@ -172,7 +121,8 @@ class NodeNeighborOverlay {
* @param node
*/
updateTabs
(
node
)
{
this
.
clearTabContentPages
();
//TODO: Write update function to update content container
/*this.clearTabContentPages();
for (const link of node.links) {
const target = link.source == node ? link.target : link.source;
...
...
@@ -182,6 +132,6 @@ class NodeNeighborOverlay {
} else {
this.tabContentPages[target.type].appendChild(reference);
}
}
}
*/
}
}
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