Hendrik testing #149

Merged
11342374 merged 27 commits from hendrik-testing into master 2017-01-27 16:16:10 +01:00
2 changed files with 21 additions and 1 deletions
Showing only changes of commit cbff973b63 - Show all commits

View File

@@ -1,5 +1,4 @@
$(document).ready(function() {
// Toggle menu
$("#own-profile-picture, #open-notifications").click(function() {
if ($("#notification-center").css('right') == "-256px") {
@@ -8,12 +7,22 @@ $(document).ready(function() {
$(".modal").width("calc(100% - 512px)");
$(".content").css("margin-right", "256px");
$("#notification-center").css("right", "0px");
// Add cookie so the menu stays open on other pages
document.cookie = "menu=open; path=/";
} else {
// Make the menu invisible and move the content to the right.
$("#chat-history").width("calc(100% - 331px)");
$(".modal").width("calc(100% - 256px)");
$(".content").css("margin-right", "0px");
$("#notification-center").css("right", "-256px");
// Change menu cookie to close
document.cookie = "menu=closed; path=/";
}
});
if (getCookie("menu") == "open") {
$("#own-profile-picture").click();
}
});

View File

@@ -1,3 +1,14 @@
function getCookie(key) {
cookies = document.cookie.split("; ");
for (var i in cookies) {
cookie = cookies[i].split("=");
if (cookie[0] == key) {
return cookie[1];
}
}
return false;
}
function editFriendship(userID, value) {
$.post("API/editFriendship.php", { usr: userID, action: value })
.done(function() {