Menu, netjes, notification

This commit is contained in:
Lars van Hijfte
2017-01-23 16:24:48 +01:00
parent 1ec8de71f0
commit 58ce5f1e75
11 changed files with 114 additions and 104 deletions

View File

@@ -13,14 +13,14 @@ $(document).ready(function() {
marginRight: "256px"
}, 500);
$(".chat-right").animate({
width: "100%"
width: "calc(100% - 512px - 40px)"
}, 500);
$("#notification-center").animate({
right: "0px"
}, 500);
} else {
$(".chat-right").animate({
width: "100%"
width: "calc(100% - 256px - 40px)"
}, 500);
$(".content").animate({
marginRight: "0px"
@@ -30,4 +30,6 @@ $(document).ready(function() {
}, 500);
}
});
$("#own-profile-picture").click();
});

View File

@@ -1,7 +1,7 @@
function showNotifications(notifications, id) {
$("#friendrequestslist").html("");
$("#" + id).html("");
for (i in notifications) {
$("#friendrequestslist").append(" \
$("#" + id).append(" \
<li class='friend-item $extraItem'> \
<form action='profile.php' method='get'> \
<button type='submit' \
@@ -20,15 +20,25 @@ function showNotifications(notifications, id) {
function loadNotifications() {
$.post(
"API/loadNotifications.php"
"API/loadFriendRequestNotifications.php"
).done(function(data) {
if (data && data != "[]") {
showNotifications(JSON.parse(data), "friendrequestslist");
}
});
$.post(
"API/loadChatNotifications.php"
).done(function(data) {
if (data && data != "[]") {
showNotifications(JSON.parse(data), "unreadChatlist");
}
});
setTimeout(loadNotifications, 10000);
}
$(document).ready(function() {
loadNotifications();
});
loadNotifications();