Don't use jQuery in the logout view script

jQuery is not available here because JavaScript is loaded after the content.
This was no problem before because the logout action was submitted using XHR and thus having JavaScript.

refs #8626
This commit is contained in:
Eric Lippmann 2015-03-11 15:35:44 +01:00
parent 0ff8416efb
commit 846a22e7a1
1 changed files with 5 additions and 6 deletions

View File

@ -18,7 +18,7 @@
); ?>
</div>
<div class="container" >
<div class="container">
<a href="<?= $this->href('dashboard/index'); ?>"><?= $this->translate('Login'); ?></a>
</div>
</div>
@ -28,8 +28,8 @@
* before it is able to finish. This will cause the browser to show a new authentication prompt in the next
* request.
*/
$(document).ready(function() {
var msg = $('#logout-status');
document.addEventListener('DOMContentLoaded', function () {
var msg = document.getElementById('logout-status');
try {
if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {
document.execCommand('ClearAuthenticationCache');
@ -41,8 +41,7 @@
}
} catch (e) {
}
msg.html('<?= $this->translate('Logout successful!'); ?>');
msg.removeClass();
msg.addClass('alert alert-success');
msg.innerHTML = '<?= $this->translate('Logout successful!'); ?>';
msg.className = 'alert alert-success';
});
</script>