Fix "Please verify your server" setting bug

This commit is contained in:
Jonathan Wong 2015-11-22 12:11:22 -08:00
parent 558f7873f5
commit 1d86187f79

View file

@ -1168,17 +1168,22 @@ $(document).ready(function() {
} }
var configForm = $("#configUpdate"); var configForm = $("#configUpdate");
function saveSettings() {
if (configForm.parsley().validate()) {
doAjaxCall('configUpdate', $(this), 'tabs', true);
postSaveChecks();
return false;
} else {
showMsg('<i class="fa fa-exclamation-circle"></i>&nbspPlease verify your settings.', false, true, 2000, true)
}
}
$('.save-button').click(function() { $('.save-button').click(function() {
if ($("#pms_identifier").val() == "") { if ($("#pms_identifier").val() == "") {
showMsg('<i class="fa fa-exclamation-circle"></i>&nbspPlease verify your server.',false,true,2000,true) //showMsg('<i class="fa fa-exclamation-circle"></i>&nbspPlease verify your server.', false, true, 2000, true)
verifyServer(function () { saveSettings() });
} else { } else {
if (configForm.parsley().validate()) { saveSettings();
doAjaxCall('configUpdate',$(this),'tabs',true);
postSaveChecks();
return false;
} else {
showMsg('<i class="fa fa-exclamation-circle"></i>&nbspPlease verify your settings.',false,true,2000,true)
}
} }
}); });
@ -1264,7 +1269,7 @@ $(document).ready(function() {
verifyServer(); verifyServer();
}); });
function verifyServer() { function verifyServer(_callback) {
var pms_ip = $("#pms_ip").val() var pms_ip = $("#pms_ip").val()
var pms_port = $("#pms_port").val() var pms_port = $("#pms_port").val()
if (($("#pms_ip").val() !== '') || ($("#pms_port").val() !== '')) { if (($("#pms_ip").val() !== '') || ($("#pms_port").val() !== '')) {
@ -1292,6 +1297,9 @@ $(document).ready(function() {
$('#pms-verify').fadeIn('fast'); $('#pms-verify').fadeIn('fast');
$("#pms-ip-group").addClass("has-error"); $("#pms-ip-group").addClass("has-error");
} }
if (_callback) {
_callback();
}
} }
}); });
} else { } else {