Commit 5835ecf7 by Bertrand Marron

Stop using JavaScript to set the body CSS class

This prevents everything from blinking, since the CSS class will be
present when the page is rendering.
parent 9132009f
......@@ -7,14 +7,14 @@
<%block name="pagetitle">${_("Log into your {platform_name} Account").format(platform_name=platform_name)}</%block>
<%block name="bodyclass">view-login</%block>
<%block name="js_extra">
<script type="text/javascript">
$(function() {
var view_name = 'view-login';
// adding js class for styling with accessibility in mind
$('body').addClass('js').addClass(view_name);
$('body').addClass('js');
// show forgot password modal UI if URL contains matching DOM ID
if ($.deparam.fragment()['forgot-password-modal'] !== undefined) {
......
......@@ -14,14 +14,14 @@
<%block name="pagetitle">${_("Preferences for {platform_name}").format(platform_name=settings.PLATFORM_NAME)}</%block>
<%block name="bodyclass">view-register</%block>
<%block name="js_extra">
<script type="text/javascript">
$(function() {
var view_name = 'view-register';
// adding js class for styling with accessibility in mind
$('body').addClass('js').addClass(view_name);
$('body').addClass('js');
// new window/tab opening
$('a[rel="external"], a[class="new-vp"]')
......
......@@ -16,14 +16,14 @@
<%block name="pagetitle">${_("Register for {platform_name}").format(platform_name=platform_name)}</%block>
<%block name="bodyclass">view-register</%block>
<%block name="js_extra">
<script type="text/javascript">
$(function() {
var view_name = 'view-register';
// adding js class for styling with accessibility in mind
$('body').addClass('js').addClass(view_name);
$('body').addClass('js');
// new window/tab opening
$('a[rel="external"], a[class="new-vp"]')
......
......@@ -23,10 +23,8 @@
<script type="text/javascript">
$(function() {
var view_name = 'view-passwordreset';
// adding js class for styling with accessibility in mind
$('body').addClass('js').addClass(view_name);
$('body').addClass('js');
// new window/tab opening
$('a[rel="external"], a[class="new-vp"]')
......
......@@ -27,10 +27,8 @@
<script type="text/javascript">
$(function() {
var view_name = 'view-passwordreset';
// adding js class for styling with accessibility in mind
$('body').addClass('js').addClass(view_name);
$('body').addClass('js');
// new window/tab opening
$('a[rel="external"], a[class="new-vp"]')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment