diff --git a/src/assets/js/NSyncPluginAsset.js b/src/assets/js/NSyncPluginAsset.js index d855f9f6..d723675a 100644 --- a/src/assets/js/NSyncPluginAsset.js +++ b/src/assets/js/NSyncPluginAsset.js @@ -87,7 +87,7 @@ addDynamicFormListener: function (event) { var that = this; $(this.element).find(this.options.dynamicFormWidgetContainer).on('afterDelete afterInsert', function (event) { - if (!that.element.find(that.options.inlineFieldSelector).data('touched')) { + if (!$(that.element).find(that.options.inlineFieldSelector).data('touched')) { that.updateInlineForm(event); } }); diff --git a/src/models/Ns.php b/src/models/Ns.php index 4d8c94c8..d0e2073c 100644 --- a/src/models/Ns.php +++ b/src/models/Ns.php @@ -3,6 +3,7 @@ namespace hipanel\modules\domain\models; use hipanel\base\Model; +use hipanel\modules\dns\validators\DomainPartValidator; use Yii; class Ns extends Model @@ -13,6 +14,7 @@ public function rules() { return [ [['name', 'ip'], 'filter', 'filter' => 'trim'], + [['name'], DomainPartValidator::className()], ]; } diff --git a/src/widgets/views/ns.php b/src/widgets/views/ns.php index ecc7bef1..2ff51b1b 100644 --- a/src/widgets/views/ns.php +++ b/src/widgets/views/ns.php @@ -1,6 +1,7 @@ assetManager->forceCopy = true; -iCheckAsset::register($this); NSyncPluginAsset::register($this); -$this->registerJs("$('#nss-form-pjax').NSync();"); - ?> - 'nss-form-pjax', 'enableReplaceState' => false, 'scrollTo' => true]) ?> + 'nss-form-pjax', 'enablePushState' => false, 'enableReplaceState' => false]) ?> +registerJs("$('#nss-form-pjax').NSync();"); ?> 'dynamic-form', 'action' => 'set-nss', @@ -29,25 +28,20 @@ -
-
- 'btn btn-default']) ?> -
-
- +
-
-
-
- field($model, 'nameservers') ?> -
-
+
+ 'form-control']) ?> +
+
+ 'btn btn-default']) ?>
+
-
+
'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_]