Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Départements-Notaires v2
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
Nicolas PICARD
Départements-Notaires v2
Commits
ab099610
Commit
ab099610
authored
4 years ago
by
Cédric Girardot
Browse files
Options
Downloads
Patches
Plain Diff
Refactor : Ajout de conditions dans app.js pour éviter les erreurs
Change-Id: If39a16ea8fa441e559cfae3400da99658897a48e
parent
8ead0664
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
appli_sf/assets/default/js/app.js
+26
-8
26 additions, 8 deletions
appli_sf/assets/default/js/app.js
with
26 additions
and
8 deletions
appli_sf/assets/default/js/app.js
+
26
−
8
View file @
ab099610
...
...
@@ -30,10 +30,16 @@ window.onload = function () {
header
.
classList
.
toggle
(
'
is-mobile-nav-open
'
);
}
menu_hamburger
.
addEventListener
(
'
click
'
,
menuClick
,
false
);
if
(
menu_hamburger
)
{
menu_hamburger
.
addEventListener
(
'
click
'
,
menuClick
,
false
);
}
// Is Mobile ?
function
checkMobile
()
{
if
(
!
menu_hamburger
)
{
return
;
}
let
mHamburgerStyle
=
getComputedStyle
(
menu_hamburger
);
if
(
mHamburgerStyle
.
display
===
'
none
'
)
{
...
...
@@ -51,20 +57,28 @@ window.onload = function () {
// Changement header au scroll
let
navTop
=
document
.
getElementsByClassName
(
'
nav-top
'
)[
0
];
let
navMiddle
=
document
.
getElementsByClassName
(
'
nav-middle
'
)[
0
];
let
styleNavTop
=
getComputedStyle
(
navTop
);
let
styleNavMiddle
=
getComputedStyle
(
navMiddle
);
let
navHeight
=
navTop
.
offsetHeight
+
parseInt
(
styleNavTop
.
marginTop
)
+
parseInt
(
styleNavTop
.
marginBottom
)
+
navMiddle
.
offsetHeight
+
parseInt
(
styleNavMiddle
.
marginTop
)
+
parseInt
(
styleNavMiddle
.
marginBottom
)
+
1
;
isScrolled
(
header
,
navTop
,
navHeight
,
this
);
if
(
navTop
)
{
let
styleNavTop
=
getComputedStyle
(
navTop
);
let
styleNavMiddle
=
getComputedStyle
(
navMiddle
);
let
navHeight
=
navTop
.
offsetHeight
+
parseInt
(
styleNavTop
.
marginTop
)
+
parseInt
(
styleNavTop
.
marginBottom
)
+
navMiddle
.
offsetHeight
+
parseInt
(
styleNavMiddle
.
marginTop
)
+
parseInt
(
styleNavMiddle
.
marginBottom
)
+
1
;
window
.
addEventListener
(
'
scroll
'
,
function
()
{
isScrolled
(
header
,
navTop
,
navHeight
,
this
);
});
window
.
addEventListener
(
'
scroll
'
,
function
()
{
isScrolled
(
header
,
navTop
,
navHeight
,
this
);
});
}
// Responsive bouton "Aide" nav
function
helpButton
()
{
let
navHelp
=
document
.
getElementsByClassName
(
'
nav-help
'
)[
0
];
if
(
!
navHelp
)
{
return
;
}
let
style
=
getComputedStyle
(
navHelp
);
let
helpWidth
=
navHelp
.
offsetWidth
+
parseInt
(
style
.
paddingLeft
)
+
parseInt
(
style
.
paddingRight
);
let
helpSpace
=
(
window
.
innerWidth
-
1050
)
/
2
;
...
...
@@ -83,6 +97,10 @@ window.onload = function () {
// Margin-top main par rapport à la hauteur de la nav
function
mainMargin
()
{
if
(
!
header
)
{
return
;
}
let
headerHeight
=
header
.
offsetHeight
;
let
main
=
document
.
getElementsByTagName
(
'
main
'
)[
0
];
...
...
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