diff --git a/modules/registrars/synergywholesaledomains/js/functions.js b/modules/registrars/synergywholesaledomains/js/functions.js index cecc145..49761b6 100644 --- a/modules/registrars/synergywholesaledomains/js/functions.js +++ b/modules/registrars/synergywholesaledomains/js/functions.js @@ -12,6 +12,24 @@ if ('undefined' !== typeof toastr) { toastr.options.fadeIn = 500; } +$(document).ready(function () { + $('#dnsrecords').delegate('select', 'change', function () { + var self = $(this); + var form = self.closest('form'); + var addressCol = form.find("div:eq(1)"); + + if (self.val() == 'SRV') { + addressCol.html('\ + \ + \ + \ + ') + } else { + addressCol.html('') + } + }); +}); + function Toast(type, css, msg) { toastr.options.positionClass = css; toastr[type](msg); @@ -198,7 +216,7 @@ function addRecord(domain_id, temprecord_id, formdata, recordType) { $('#form-' + data.record_id + ' input[name=address]').val(data.recordContent); $('#form-' + data.record_id + ' input[name=ttl]').val(data.recordTTL); - if ('undefined' !== typeof data.recordPrio && 'MX' === data.recordType) { + if ('undefined' !== typeof data.recordPrio && ('MX' === data.recordType || 'SRV' === data.recordType)) { $('#form-' + data.record_id + ' input[name=priority]').val(data.recordPrio); } else { $('#form-' + data.record_id + ' input[name=priority]').val('N/A'); @@ -270,7 +288,7 @@ function saveRecord(domain_id, record_id, formdata, recordType) { $('#form-' + data.record_id + ' input[name=hostname]').val(data.recordName); $('#form-' + data.record_id + ' input[name=address]').val(data.recordContent); $('#form-' + data.record_id + ' input[name=ttl]').val(data.recordTTL); - if (typeof data.recordPrio !== 'undefined' && data.recordType == 'MX') { + if (typeof data.recordPrio !== 'undefined' && (data.recordType == 'MX' || data.recordType == 'SRV')) { $('#form-' + data.record_id + ' input[name=priority]').val(data.recordPrio); } else { $('#form-' + data.record_id + ' input[name=priority]').val('N/A'); @@ -328,7 +346,7 @@ function populateDNSRow(record_id, domain, hostname, type, ttl, address, priorit `; } - let template = `