Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
splashify
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Show more breadcrumbs
project
splashify
Merge requests
!15
Issue
#3443644
: Fix eslint warnings
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#3443644
: Fix eslint warnings
issue/splashify-3443644:3443644-fix-eslint-warnings
into
8.x-2.x
Overview
0
Commits
4
Pipelines
4
Changes
5
Open
Evgen Tolstoy
requested to merge
issue/splashify-3443644:3443644-fix-eslint-warnings
into
8.x-2.x
3 months ago
Overview
0
Commits
4
Pipelines
4
Changes
5
Expand
Closes
#3443644
0
0
Merge request reports
Compare
8.x-2.x
version 3
6edc8d75
3 months ago
version 2
1542a884
3 months ago
version 1
76696bf6
3 months ago
8.x-2.x (HEAD)
and
latest version
latest version
59c6c9e4
4 commits,
3 months ago
version 3
6edc8d75
3 commits,
3 months ago
version 2
1542a884
2 commits,
3 months ago
version 1
76696bf6
1 commit,
3 months ago
5 files
+
90
−
77
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
js/splashify_full_screen.js
+
58
−
39
Options
(
function
(
$
)
{
Drupal
.
behaviors
.
splashifyBehavior
.
full_screen
=
function
(
context
,
settings
)
{
var
splash_height
=
$
(
window
).
height
();
Drupal
.
behaviors
.
splashifyBehavior
.
full_screen
=
function
(
context
,
settings
,
)
{
const
splashHeight
=
$
(
window
).
height
();
$
(
'
#splashify
'
,
context
).
once
(
'
splashify_open
'
).
each
(
function
()
{
var
$splash
=
$
(
this
);
// Open the splash div.
function
openSplash
(
$splash
)
{
const
$body
=
$
(
'
body
'
);
$body
.
addClass
(
'
splash-active
'
);
const
originalHeight
=
$splash
.
attr
(
'
originalheight
'
);
if
(
originalHeight
)
{
$body
[
0
].
style
.
marginTop
=
`
${
originalHeight
}
px`
;
const
splashWrapper
=
document
.
querySelector
(
'
.splash-wrapper
'
);
if
(
splashWrapper
)
{
splashWrapper
.
style
.
height
=
`
${
originalHeight
}
px`
;
}
}
window
.
scrollTo
(
0
,
0
);
}
$
(
'
#splashify
'
,
context
)
.
once
(
'
splashify_open
'
)
.
each
(
function
()
{
const
$splash
=
$
(
this
);
// Get the height of the div. Set it as a custom attribute.
// Update the height to 0 and then show the div.
$
(
'
body
'
).
css
(
'
margin-top
'
,
splash
_h
eight
)
;
$splash
.
attr
(
'
originalheight
'
,
splash
_h
eight
+
'
px
'
);
$splash
.
css
(
'
position
'
,
'
absolute
'
)
;
$splash
.
css
(
'
display
'
,
'
block
'
)
;
document
.
body
.
style
.
marginTop
=
splash
H
eight
;
$splash
.
setAttribute
(
'
originalheight
'
,
`
${
splash
H
eight
}
px
`
);
$splash
.
style
.
position
=
'
absolute
'
;
$splash
.
style
.
display
=
'
block
'
;
// Open the splash.
openSplash
(
$splash
);
// Track scroll position to destroy splash
$
(
context
).
once
(
'
splashify_scroll
'
).
on
(
'
scroll.splash
'
,
function
()
{
var
$object
=
$
(
this
);
var
scroll_position
=
$object
.
scrollTop
();
if
(
scroll_position
>=
splash_height
)
{
$object
.
scrollTop
(
0
);
// Destroy the splash div...they scrolled passed it.
var
$body
=
$
(
'
body
'
);
$body
.
removeClass
(
'
splash-active
'
);
$body
.
css
(
'
margin-top
'
,
0
);
$
(
'
#splashify
'
,
context
).
css
(
'
height
'
,
0
);
$object
.
off
(
'
scroll.splash
'
);
}
});
});
$
(
context
)
.
once
(
'
splashify_scroll
'
)
.
on
(
'
scroll.splash
'
,
function
()
{
const
$object
=
$
(
this
);
const
scrollPosition
=
$object
.
scrollTop
();
if
(
scrollPosition
>=
splashHeight
)
{
$object
.
scrollTop
(
0
);
// Destroy the splash div, they scrolled passed it.
const
$body
=
$
(
'
body
'
);
$body
.
removeClass
(
'
splash-active
'
);
$body
[
0
].
style
.
marginTop
=
'
0
'
;
// Open the splash div.
function
openSplash
(
$splash
)
{
var
$body
=
$
(
'
body
'
);
$body
.
addClass
(
'
splash-active
'
);
$body
.
css
(
'
margin-top
'
,
$splash
.
attr
(
'
originalheight
'
));
$
(
'
.splash-wrapper
'
).
css
(
'
height
'
,
$splash
.
attr
(
'
originalheight
'
));
window
.
scrollTo
(
0
,
0
);
}
const
splashify
=
document
.
getElementById
(
'
splashify
'
);
if
(
splashify
)
{
splashify
.
style
.
height
=
'
0
'
;
}
// Close the splash div.
function
closeSplash
()
{
var
$body
=
$
(
'
body
'
);
$body
.
removeClass
(
'
splash-active
'
);
$body
.
css
(
'
margin-top
'
,
0
);
$
(
'
.splash-wrapper
'
).
css
(
'
height
'
,
0
);
}
$object
.
off
(
'
scroll.splash
'
);
}
});
});
// Close the splash div.
function
closeSplash
()
{
const
$body
=
$
(
'
body
'
);
$body
.
removeClass
(
'
splash-active
'
);
$body
[
0
].
style
.
marginTop
=
'
0
'
;
document
.
querySelector
(
'
.splash-wrapper
'
).
style
.
height
=
'
0
'
;
}
};
})(
jQuery
);
Loading