Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eDisplay
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Green Science
eDisplay
Commits
99bba8f9
Commit
99bba8f9
authored
5 years ago
by
Lillian Gray
Browse files
Options
Downloads
Patches
Plain Diff
Hide other series menus when a menu is opened #13
parent
b4fbfa50
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/main.js
+18
-7
18 additions, 7 deletions
js/main.js
with
18 additions
and
7 deletions
js/main.js
+
18
−
7
View file @
99bba8f9
...
...
@@ -231,18 +231,29 @@ $(window).resize(function() {
dashboard
.
draw
(
lineChartData
)
})
//called if series menu is clicked, toggles menu being shown
//called if series menu is clicked, toggles menu being shown
and hides other menus
function
showSeriesOptions
(
el
)
{
el
.
nextElementSibling
.
classList
.
toggle
(
'
displayNone
'
)
var
optionsClosed
=
el
.
nextElementSibling
.
classList
.
contains
(
"
displayNone
"
)
//close all menus
hideSeriesOptions
()
//only opens menu if it was previously closed
if
(
optionsClosed
)
{
el
.
nextElementSibling
.
classList
.
remove
(
'
displayNone
'
)
}
}
document
.
addEventListener
(
"
click
"
,
function
(
event
)
{
if
(
event
.
target
.
closest
(
"
.seriesSelectDropUp
"
))
return
;
elements
=
document
.
getElementsByClassName
(
"
seriesSelectOptions
"
)
//hides all series menus
function
hideSeriesOptions
()
{
var
elements
=
document
.
getElementsByClassName
(
"
seriesSelectOptions
"
)
for
(
var
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
elements
[
i
].
classList
.
add
(
'
displayNone
'
)
}
}
}
//hides series menus if user clicks outside of them
document
.
addEventListener
(
"
click
"
,
function
(
event
)
{
if
(
event
.
target
.
closest
(
"
.seriesSelectDropUp
"
))
return
;
hideSeriesOptions
()
});
//if site was loaded using a permalink, modifies startDate, endDate, and whichBuildings
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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