added ability to not select a subdomain

This commit is contained in:
Jon Lambson 2017-11-06 12:59:29 -07:00
parent 574857233d
commit a47b7ac969
1 changed files with 10 additions and 8 deletions

View File

@ -180,12 +180,11 @@ app.controller('websiteCtrl', [
// TODO set record based on (record.host === sub + domain.domain) // TODO set record based on (record.host === sub + domain.domain)
var sub = vm.newRecord; var sub = vm.newRecord;
if ('@' === sub) { if ('@' === sub || sub === undefined) {
sub = ''; sub = '';
} }
vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain }; vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain };
vm.currentHost = vm.record.host; vm.currentHost = vm.record.host;
console.log('[setRecord] vm.record:'); console.log('[setRecord] vm.record:');
console.log(vm.record); console.log(vm.record);
}; };
@ -290,9 +289,9 @@ app.controller('websiteCtrl', [
return; return;
} }
if (!vm.currentHost) { if (!vm.currentHost) {
window.alert('No hostname chosen.'); vm.setRecord();
return;
} }
debugger;
if (vm.domain) { if (vm.domain) {
if (!vm.domain.tld || !vm.domain.sld) { if (!vm.domain.tld || !vm.domain.sld) {
@ -764,10 +763,11 @@ app.controller('websiteCtrl', [
$scope.domain = vm.domains; $scope.domain = vm.domains;
} }
}) })
} else {
vm.domains = els; vm.domains = els;
$scope.domain = vm.domains; $scope.domain = vm.domains;
} }
vm.domains = els;
$scope.domain = vm.domains;
}); });
vm.listSites(); vm.listSites();
@ -795,9 +795,11 @@ app.controller('websiteCtrl', [
vm.breadcrumbs.push(crumb); vm.breadcrumbs.push(crumb);
} }
}); });
if (vm.copyR.shareAccess.path !== '/') { if (vm.copyR !== undefined) {
} else { if (vm.copyR.shareAccess.path !== '/') {
vm.breadcrumbs.unshift('root'); } else {
vm.breadcrumbs.unshift('root');
}
} }
}; };