Просмотр исходного кода

Fix: Undefined error in Edit/Add DNS hint (#3263)

Jaap Marcus 3 лет назад
Родитель
Сommit
3d8023475b
2 измененных файлов с 6 добавлено и 4 удалено
  1. 3 2
      web/js/pages/add_dns_rec.js
  2. 3 2
      web/js/pages/edit_dns_rec.js

+ 3 - 2
web/js/pages/add_dns_rec.js

@@ -2,6 +2,7 @@
 //
 //
 // Updates database dns record dynamically, showing its full domain path
 // Updates database dns record dynamically, showing its full domain path
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
+	domain = $('input[name="v_domain"]').val();
 	// clean hint
 	// clean hint
 	if (hint.trim() == '') {
 	if (hint.trim() == '') {
 		$(elm).parent().find('.hint').text('');
 		$(elm).parent().find('.hint').text('');
@@ -13,7 +14,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	}
 	}
 
 
 	// dont show pregix if domain name = rec value
 	// dont show pregix if domain name = rec value
-	if (hint == Alpine.store('globals').DNS_REC_PREFIX + '.') {
+	if (hint == domain) {
 		hint = '';
 		hint = '';
 	}
 	}
 
 
@@ -25,7 +26,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
 		.find('.hint')
 		.find('.hint')
-		.text(hint + Alpine.store('globals').DNS_REC_PREFIX);
+		.text(hint + domain);
 };
 };
 
 
 //
 //

+ 3 - 2
web/js/pages/edit_dns_rec.js

@@ -3,6 +3,7 @@
 // Updates database dns record dynamically, showing its full domain path
 // Updates database dns record dynamically, showing its full domain path
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	// clean hint
 	// clean hint
+	domain = $('input[name="v_domain"]').val();
 	if (hint.trim() == '') {
 	if (hint.trim() == '') {
 		$(elm).parent().find('.hint').text('');
 		$(elm).parent().find('.hint').text('');
 	}
 	}
@@ -13,7 +14,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	}
 	}
 
 
 	// dont show prefix if domain name = rec value
 	// dont show prefix if domain name = rec value
-	if (hint == Alpine.store('globals').DNS_REC_PREFIX + '.') {
+	if (hint == domain) {
 		hint = '';
 		hint = '';
 	}
 	}
 
 
@@ -25,7 +26,7 @@ App.Actions.DB.update_dns_record_hint = function (elm, hint) {
 	$(elm)
 	$(elm)
 		.parent()
 		.parent()
 		.find('.hint')
 		.find('.hint')
-		.text(hint + Alpine.store('globals').DNS_REC_PREFIX);
+		.text(hint + domain);
 };
 };
 
 
 //
 //