mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-24 17:27:55 -05:00
Don't lose disabled setting on email config submit (#441)
This commit is contained in:
@@ -115,10 +115,6 @@
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$('#email_config_form').validate($.extend(form_support.handler, {
|
||||
errorLabelContainer: "#email_error_message_box"
|
||||
}));
|
||||
|
||||
var check_protocol = function() {
|
||||
if($("#protocol").val() == 'sendmail')
|
||||
{
|
||||
@@ -137,5 +133,24 @@ $(document).ready(function()
|
||||
};
|
||||
|
||||
$("#protocol").change(check_protocol).ready(check_protocol);
|
||||
|
||||
$('#email_config_form').validate($.extend(form_support.handler, {
|
||||
submitHandler: function(form) {
|
||||
$(form).ajaxSubmit({
|
||||
beforeSerialize: function(arr, $form, options) {
|
||||
$("#mailpath, #smtp_host, #smtp_user, #smtp_pass, #smtp_port, #smtp_timeout, #smtp_crypto").prop("disabled", false);
|
||||
return true;
|
||||
},
|
||||
success: function(response) {
|
||||
$.notify(response.message, { type: response.success ? 'success' : 'danger'} );
|
||||
// set back disabled state
|
||||
check_protocol();
|
||||
},
|
||||
dataType:'json'
|
||||
});
|
||||
},
|
||||
|
||||
errorLabelContainer: "#email_error_message_box"
|
||||
}));
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -77,8 +77,9 @@ $(document).ready(function()
|
||||
$("#sales_invoice_format, #recv_invoice_format, #invoice_default_comments, #invoice_email_message").prop('disabled', !invoice_enable);
|
||||
return arguments.callee;
|
||||
})();
|
||||
|
||||
$("#invoice_enable").change(enable_disable_invoice_enable);
|
||||
|
||||
|
||||
$('#invoice_config_form').validate($.extend(form_support.handler, {
|
||||
submitHandler: function(form) {
|
||||
$(form).ajaxSubmit({
|
||||
|
||||
Reference in New Issue
Block a user