From a47b7ac96957fd8a9e3ffa095e5ea24872b9394e Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Mon, 6 Nov 2017 12:59:29 -0700 Subject: [PATCH] added ability to not select a subdomain --- js/controllers/website-controller.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/js/controllers/website-controller.js b/js/controllers/website-controller.js index 4c569ce..38123a4 100644 --- a/js/controllers/website-controller.js +++ b/js/controllers/website-controller.js @@ -180,12 +180,11 @@ app.controller('websiteCtrl', [ // TODO set record based on (record.host === sub + domain.domain) var sub = vm.newRecord; - if ('@' === sub) { + if ('@' === sub || sub === undefined) { sub = ''; } vm.record = { sub: sub, host: (sub ? sub + '.' : '') + vm.domain.domain }; vm.currentHost = vm.record.host; - console.log('[setRecord] vm.record:'); console.log(vm.record); }; @@ -290,9 +289,9 @@ app.controller('websiteCtrl', [ return; } if (!vm.currentHost) { - window.alert('No hostname chosen.'); - return; + vm.setRecord(); } + debugger; if (vm.domain) { if (!vm.domain.tld || !vm.domain.sld) { @@ -764,10 +763,11 @@ app.controller('websiteCtrl', [ $scope.domain = vm.domains; } }) - } else { vm.domains = els; $scope.domain = vm.domains; } + vm.domains = els; + $scope.domain = vm.domains; }); vm.listSites(); @@ -795,9 +795,11 @@ app.controller('websiteCtrl', [ vm.breadcrumbs.push(crumb); } }); - if (vm.copyR.shareAccess.path !== '/') { - } else { - vm.breadcrumbs.unshift('root'); + if (vm.copyR !== undefined) { + if (vm.copyR.shareAccess.path !== '/') { + } else { + vm.breadcrumbs.unshift('root'); + } } };