diff --git a/resources/assets/backend/js/pace.js b/resources/assets/backend/js/pace.js index a5ed0849..49050fda 100755 --- a/resources/assets/backend/js/pace.js +++ b/resources/assets/backend/js/pace.js @@ -432,7 +432,7 @@ async: true }); } - return _open.apply(req, arguments, true); + return _open.call(req, type, url, async || true); }; }; window.XMLHttpRequest = function(flags) { diff --git a/resources/assets/backend/js/theme_settings.js b/resources/assets/backend/js/theme_settings.js index c2e490e4..eda5d856 100755 --- a/resources/assets/backend/js/theme_settings.js +++ b/resources/assets/backend/js/theme_settings.js @@ -218,47 +218,54 @@ $(function () { success: function (response) { localStorage.setItem('notiCallTime', new Date()); localStorage.setItem('notifications', JSON.stringify(response)); - }, - async: false + renderNotification(); + } }); } + else{ + renderNotification(); + } - var notifications = (typeof (localStorage.getItem('notifications')) !== "undefined") ? JSON.parse(localStorage.getItem('notifications')) : []; - // console.log(notifications); - $('.notificaton_header').text('You have '+notifications.length+' recent notifications'); - $('.notification_badge').text(notifications.length); - $('ul.notification_top').empty(); - notifications.forEach(function(notification, index){ - var notiIcon = "fa-times-circle text-danger"; - switch (notification.type){ - case "info": - notiIcon = "fa-info-circle"; - break; - case "warning": - notiIcon = "fa-warning text-warning"; - break; - case "success": - notiIcon = "fa-check-circle text-success"; - break; - default: - break; - } - - var li = '
  • \n' + - '\n' + - '
    \n'+ - ' \n' + - '
    \n' + - '

    '+ notification.message +'

    \n' + - '

    '+ notification.created_at +'

    \n' + - '
    \n' + - '
  • '; - $('ul.notification_top').append(li); - }) } } + + function renderNotification() { + var notifications = (localStorage.getItem('notifications')) ? JSON.parse(localStorage.getItem('notifications')) : []; + // console.log(notifications); + $('.notificaton_header').text('You have '+notifications.length+' recent notifications'); + $('.notification_badge').text(notifications.length); + $('ul.notification_top').empty(); + var notiIcon = "fa-times-circle text-danger"; + notifications.forEach(function(notification, index){ + switch (notification.type){ + case "info": + notiIcon = "fa-info-circle text-info"; + break; + case "warning": + notiIcon = "fa-warning text-warning"; + break; + case "success": + notiIcon = "fa-check-circle text-success"; + break; + default: + break; + } + + var li = '
  • \n' + + '\n' + + '
    \n'+ + ' \n' + + '
    \n' + + '

    '+ notification.message +'

    \n' + + '

    '+ notification.created_at +'

    \n' + + '
    \n' + + '
  • '; + $('ul.notification_top').append(li); + }) + } + /** * Retrieve default settings and apply them to the template