Commit 9b9426f2 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Do loading on every AJAX request, fix SVG image and make it bigger

parent 87686446
This diff is collapsed.
const gravatar = require('gravatar'); const gravatar = require('gravatar');
const _loading = require('../Helper/Loading');
const NotifyMessage = require('./NotifyMessage'); const NotifyMessage = require('./NotifyMessage');
const FlyOutAjaxLogin = function (props) { const FlyOutAjaxLogin = function (props) {
FlyOutAjaxLogin.settings = props; FlyOutAjaxLogin.settings = props;
...@@ -27,7 +26,7 @@ FlyOutAjaxLogin.prototype.authenticationRequest = function(event, form) { ...@@ -27,7 +26,7 @@ FlyOutAjaxLogin.prototype.authenticationRequest = function(event, form) {
url: form.data('action'), url: form.data('action'),
type: 'POST', type: 'POST',
data: form.serialize(), data: form.serialize(),
async: false, async: true,
success: function (returnValue) { success: function (returnValue) {
returnValue = '<html><body>' + returnValue + '</body></html>'; returnValue = '<html><body>' + returnValue + '</body></html>';
let alertType = $(returnValue).find('#message div').prop('class'); let alertType = $(returnValue).find('#message div').prop('class');
...@@ -87,12 +86,6 @@ FlyOutAjaxLogin.prototype.initLoginLogoutTemplate = function () { ...@@ -87,12 +86,6 @@ FlyOutAjaxLogin.prototype.initLoginLogoutTemplate = function () {
const loginForm = $('#login-form'); const loginForm = $('#login-form');
const logoutForm = $('#logout-form'); const logoutForm = $('#logout-form');
const loginObject = new FlyOutAjaxLogin(); const loginObject = new FlyOutAjaxLogin();
$(document).ajaxStart(
function () {
_loading.show();
}).ajaxStop(function () {
_loading.hide();
});
const email = $('#gravatar-image').data('email'); const email = $('#gravatar-image').data('email');
$('#gravatar-image').append('<img src="' + gravatar.url(email, {s: '100'}, true) + '" alt="" class="rounded-circle" />'); $('#gravatar-image').append('<img src="' + gravatar.url(email, {s: '100'}, true) + '" alt="" class="rounded-circle" />');
......
...@@ -17,7 +17,15 @@ require('bootstrap4-notify'); ...@@ -17,7 +17,15 @@ require('bootstrap4-notify');
const baguetteBox = require('baguettebox.js'); const baguetteBox = require('baguettebox.js');
const FlyOutAjaxLogin = require('./Module/FlyOutAjaxLogin'); // Load tether into global `AjaxLogin` const FlyOutAjaxLogin = require('./Module/FlyOutAjaxLogin'); // Load tether into global `AjaxLogin`
const feedback = require('./Module/Feedback'); const feedback = require('./Module/Feedback');
const _loading = require('./Helper/Loading');
$(document).ajaxStart(
function () {
_loading.show();
}).ajaxStop(function () {
_loading.hide();
}
);
$(document).ready(function () { $(document).ready(function () {
if ($('.table.table-striped').length) { if ($('.table.table-striped').length) {
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
img { img {
width: 4em; width: 8em;
height: 4em; height: 8em;
animation: beatHeart 0.8s infinite; animation: beatHeart 0.8s infinite;
} }
} }
......
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