Browse Source

qsdqsd

master
johan 3 years ago
parent
commit
c6ca4bf4c6
  1. 44
      static/js/main.js

44
static/js/main.js

@ -266,7 +266,8 @@ function get_admin(type) {
<div id="switch-state">${text}</div> <div id="switch-state">${text}</div>
</span> </span>
</span> </span>
`) `);
refreshListener();
} }
} }
}); });
@ -381,27 +382,6 @@ function get_admin(type) {
} }
function refreshListener() { function refreshListener() {
$('#switch-state').click(() => {
$.ajax({
type: "POST",
url: base_url + "switchState",
data: JSON.stringify({
uid: localStorage.getItem('user'),
token: localStorage.getItem('token'),
}),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
if(data.state == 'open') {
$("#switch-state").text('Vérouiller');
} else {
$("#switch-state").text('Dévérouiller');
}
}
})
});
$(".prank-btn-accept").click((e) => { $(".prank-btn-accept").click((e) => {
let uid = e.target.parentNode.parentNode.id let uid = e.target.parentNode.parentNode.id
@ -671,6 +651,26 @@ function refreshListener() {
$('.overlay').css({"opacity": 1, "visibility": "visible"}); $('.overlay').css({"opacity": 1, "visibility": "visible"});
}); });
$('#switch-state').click((e) => {
$.ajax({
type: "POST",
url: base_url + "switchState",
data: JSON.stringify({
uid: localStorage.getItem('user'),
token: localStorage.getItem('token'),
}),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
if(data.state == 'open') {
$("#switch-state").text('Vérouiller');
} else {
$("#switch-state").text('Dévérouiller');
}
}
});
});
} }
$('.close').click((e) => { $('.close').click((e) => {

Loading…
Cancel
Save