cleanup code
This commit is contained in:
parent
fbac0c8d26
commit
3fad7f2d6d
|
|
@ -8,21 +8,11 @@ function validate(what, text) {
|
|||
$(document).ready(function () {
|
||||
$(".show-modal").click(function () {
|
||||
$("#alias_exclamation").hide();
|
||||
$("#smsnumber_exclamation").hide();
|
||||
var alias = $(this).prev().html();
|
||||
var deveui = $(this).prev().attr('id').replace("alias_", "");
|
||||
$('#deveui').html(deveui);
|
||||
var alarmactive = $('#alarmactive_' + deveui).html();
|
||||
var smsnumber = $('#smsnumber_' + deveui).html();
|
||||
|
||||
$("#alias").val(alias);
|
||||
console.log(alarmactive);
|
||||
if (alarmactive == "1") {
|
||||
$('#checkbox').prop('checked', true);
|
||||
} else {
|
||||
$('#checkbox').prop('checked', false);
|
||||
}
|
||||
$("#smsnumber").val(smsnumber);
|
||||
$("#modal").addClass("is-active");
|
||||
});
|
||||
|
||||
|
|
@ -118,11 +108,6 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
$("#modal-save").click(function () {
|
||||
var alarmactive = "0";
|
||||
if ($('#checkbox').prop('checked')) {
|
||||
alarmactive = "1";
|
||||
}
|
||||
|
||||
// Validation Code
|
||||
var is_valid = true;
|
||||
if (!validate('alias', $('#alias').val())) {
|
||||
|
|
@ -141,7 +126,7 @@ $(document).ready(function () {
|
|||
}
|
||||
|
||||
$.ajax({
|
||||
url: "save_scale_settings",
|
||||
url: "save_tracker_settings",
|
||||
type: "get", //send it through get method
|
||||
dataType: "json",
|
||||
data: {
|
||||
|
|
@ -294,7 +279,6 @@ var woBischIcon = L.icon({
|
|||
var maps = [];
|
||||
$(document).ready(function () {
|
||||
$(".tracker").each(function (index) {
|
||||
console.log('Draw Map (' + index + "): " + $(this).find(".alias").html());
|
||||
|
||||
deveui = $(this).find("div").first().attr("id");
|
||||
lat = $(this).find("#lat").html();
|
||||
|
|
|
|||
Loading…
Reference in New Issue