Avoid flickering welcome banner
Make the welcome banner default to being hidden and then show it (by adding a class) if there is no cookie. Fixes #1951
This commit is contained in:
parent
a7cdb0298d
commit
1a66467ef6
3 changed files with 18 additions and 8 deletions
|
@ -187,12 +187,12 @@ $(document).ready(function () {
|
|||
$.cookie('_osm_location', OSM.locationCookie(map), { expires: expiry, path: '/' });
|
||||
});
|
||||
|
||||
if ($.cookie('_osm_welcome') === 'hide') {
|
||||
$('.welcome').hide();
|
||||
if ($.cookie('_osm_welcome') !== 'hide') {
|
||||
$('.welcome').addClass('visible');
|
||||
}
|
||||
|
||||
$('.welcome .close-wrap').on('click', function() {
|
||||
$('.welcome').hide();
|
||||
$('.welcome').removeClass('visible');
|
||||
$.cookie('_osm_welcome', 'hide', { expires: expiry, path: '/' });
|
||||
});
|
||||
|
||||
|
|
|
@ -611,11 +611,18 @@ body.compact {
|
|||
height: auto;
|
||||
overflow: hidden;
|
||||
|
||||
#banner,
|
||||
.welcome {
|
||||
#banner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
display: none;
|
||||
|
||||
&.visible {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
#sidebar_content {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -126,9 +126,12 @@ body.small {
|
|||
}
|
||||
}
|
||||
|
||||
#sidebar .welcome,
|
||||
#sidebar #banner {
|
||||
display: none !important;
|
||||
.overlay-sidebar #sidebar .welcome.visible {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.overlay-sidebar #sidebar #banner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.leaflet-top.leaflet-right {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue