[ticket/11552] Add .nojs or .hasjs to body

Add .nojs to body element, swap it to .hasjs when
JavaScript is enabled

PHPBB3-11552
This commit is contained in:
Vjacheslav Trushkin 2013-09-14 22:56:40 +03:00
parent befffe7472
commit a189c38853
3 changed files with 5 additions and 2 deletions

View file

@ -414,6 +414,9 @@ function insert_single_user(formId, user)
*/ */
(function($) { (function($) {
$(document).ready(function() { $(document).ready(function() {
// Swap .nojs and .hasjs
$('#phpbb.nojs').toggleClass('nojs hasjs');
// Focus forms // Focus forms
$('form[data-focus]:first').each(function() { $('form[data-focus]:first').each(function() {
$('#' + this.getAttribute('data-focus')).focus(); $('#' + this.getAttribute('data-focus')).focus();

View file

@ -49,7 +49,7 @@
{$STYLESHEETS} {$STYLESHEETS}
</head> </head>
<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}"> <body id="phpbb" class="nojs section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
<div id="wrap"> <div id="wrap">
<a id="top" accesskey="t"></a> <a id="top" accesskey="t"></a>

View file

@ -26,7 +26,7 @@
</head> </head>
<body id="phpbb" class="{S_CONTENT_DIRECTION}"> <body id="phpbb" class="nojs {S_CONTENT_DIRECTION}">
<div id="simple-wrap"> <div id="simple-wrap">
<a id="top" accesskey="t"></a> <a id="top" accesskey="t"></a>