Skip to content

Commit

Permalink
Improve lack of JavaScript management
Browse files Browse the repository at this point in the history
Remove menu flickering when loading big pages
  • Loading branch information
flodolo committed Jan 4, 2016
1 parent 2831c6c commit ed88681
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
5 changes: 4 additions & 1 deletion app/views/templates/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@
<link rel="shortcut icon" type="image/x-icon" href="https://www.mozfr.org/favicon.ico" />
<link rel="alternate" type="application/rss+xml" title="Changelog RSS" href="/rss" />
</head>
<body id="<?= $page ?>">
<body id="<?= $page ?>" class="nojs">
<script>
document.getElementsByTagName('body')[0].className = 'jsEnabled';
</script>
<div id="links-top" class="links">
<div class="container">
<?= $links ?>
Expand Down
4 changes: 0 additions & 4 deletions web/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ $(document).ready(function() {
.prop('selected', true);
});

// Javascript is enabled, hide the menu without transitions
hideMenuButton(0);
$('#noscript-warning').hide();

// Hides search options on small screens (check if the warning is displayed)
if ($('.smallscreen_notices').is(':visible')) {
$('#searchoptions').hide();
Expand Down
18 changes: 16 additions & 2 deletions web/style/transvision.css
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,14 @@ h3 {
#links-top {
width: 100%;
background: #fff;
display: block;
margin: 0;
padding: 50px 0 20px;
float: left;
display: none;
}

.nojs #links-top {
display: block;
}

#links-top .container {
Expand All @@ -228,7 +232,11 @@ h3 {
margin-right: 5px;
width: 125px;
height: 36px;
background: url(/img/menu.png) center -38px no-repeat transparent;
background: url(/img/menu.png) center 0 no-repeat transparent;
}

.nojs #links-top-button {
background-position: 0 -38px;
}

.selected_view,
Expand All @@ -242,6 +250,12 @@ h3 {
text-align: center;
font-weight: bold;
padding: 0 30px;
margin-top: 20px;
display: none;
}

.nojs #noscript-warning {
display: block;
}

/* Tables */
Expand Down

0 comments on commit ed88681

Please sign in to comment.