Browse Source

JavaScript: Improve control flow of development mode function

master
Riyyi 3 years ago
parent
commit
9af5f50135
  1. 12
      public/js/app.js

12
public/js/app.js

@ -241,7 +241,12 @@ $(document).ready(function() {
$.get('/admin/toggle-development-mode').done(function(data)
{
const response = JSON.parse(data);
if (response.success == true) {
if (response.success == false) {
console.log(data);
alert("Development mode could not be enabled!");
return;
}
if (response.result.value == 'on') {
e.target.checked = true;
$('#develop-enabled').css('visibility', 'visible');
@ -253,11 +258,6 @@ $(document).ready(function() {
}
alert("Development mode has been set to: '" + response.result.value + "'");
}
else {
console.log(data);
alert("Development mode could not be enabled!")
}
});
});

Loading…
Cancel
Save