Skip to content

Commit ed88681

Browse files
committed
Improve lack of JavaScript management
Remove menu flickering when loading big pages
1 parent 2831c6c commit ed88681

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

app/views/templates/base.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@
8181
<link rel="shortcut icon" type="image/x-icon" href="https://www.mozfr.org/favicon.ico" />
8282
<link rel="alternate" type="application/rss+xml" title="Changelog RSS" href="/rss" />
8383
</head>
84-
<body id="<?= $page ?>">
84+
<body id="<?= $page ?>" class="nojs">
85+
<script>
86+
document.getElementsByTagName('body')[0].className = 'jsEnabled';
87+
</script>
8588
<div id="links-top" class="links">
8689
<div class="container">
8790
<?= $links ?>

web/js/base.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ $(document).ready(function() {
5151
.prop('selected', true);
5252
});
5353

54-
// Javascript is enabled, hide the menu without transitions
55-
hideMenuButton(0);
56-
$('#noscript-warning').hide();
57-
5854
// Hides search options on small screens (check if the warning is displayed)
5955
if ($('.smallscreen_notices').is(':visible')) {
6056
$('#searchoptions').hide();

web/style/transvision.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,14 @@ h3 {
201201
#links-top {
202202
width: 100%;
203203
background: #fff;
204-
display: block;
205204
margin: 0;
206205
padding: 50px 0 20px;
207206
float: left;
207+
display: none;
208+
}
209+
210+
.nojs #links-top {
211+
display: block;
208212
}
209213

210214
#links-top .container {
@@ -228,7 +232,11 @@ h3 {
228232
margin-right: 5px;
229233
width: 125px;
230234
height: 36px;
231-
background: url(/img/menu.png) center -38px no-repeat transparent;
235+
background: url(/img/menu.png) center 0 no-repeat transparent;
236+
}
237+
238+
.nojs #links-top-button {
239+
background-position: 0 -38px;
232240
}
233241

234242
.selected_view,
@@ -242,6 +250,12 @@ h3 {
242250
text-align: center;
243251
font-weight: bold;
244252
padding: 0 30px;
253+
margin-top: 20px;
254+
display: none;
255+
}
256+
257+
.nojs #noscript-warning {
258+
display: block;
245259
}
246260

247261
/* Tables */

0 commit comments

Comments
 (0)