Skip to content

Commit

Permalink
Merge branch 'v2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshadhin committed Jun 22, 2019
2 parents cc52ad7 + 4d4ed15 commit 3fd70e1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 35 deletions.
2 changes: 1 addition & 1 deletion resources/assets/backend/js/pace.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 41 additions & 34 deletions resources/assets/backend/js/theme_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<li>\n' +
'<a href="#">\n' +
' <div class="pull-left">\n'+
' <i class="fa '+ notiIcon +'"></i>\n' +
'</div>\n' +
' <h4 class="notification_title">'+ notification.message +'</h4>\n' +
' <p><small class="pull-right"><i class="fa fa-clock-o"></i> '+ notification.created_at +'</small></p>\n' +
'</a>\n' +
'</li>';
$('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 = '<li>\n' +
'<a href="#">\n' +
' <div class="pull-left">\n'+
' <i class="fa '+ notiIcon +'"></i>\n' +
'</div>\n' +
' <h4 class="notification_title">'+ notification.message +'</h4>\n' +
' <p><small class="pull-right"><i class="fa fa-clock-o"></i> '+ notification.created_at +'</small></p>\n' +
'</a>\n' +
'</li>';
$('ul.notification_top').append(li);
})
}


/**
* Retrieve default settings and apply them to the template
Expand Down

0 comments on commit 3fd70e1

Please sign in to comment.