Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Nov 24, 2015
1 parent 5e63c79 commit 91fd645
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/assets/js/NSyncPluginAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/models/Ns.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,6 +14,7 @@ public function rules()
{
return [
[['name', 'ip'], 'filter', 'filter' => 'trim'],
[['name'], DomainPartValidator::className()],
];
}

Expand Down
28 changes: 11 additions & 17 deletions src/widgets/views/ns.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use hipanel\modules\domain\assets\NSyncPluginAsset;
use hipanel\widgets\Box;
use hipanel\widgets\Pjax;
use hiqdev\assets\icheck\iCheckAsset;
use wbraganca\dynamicform\DynamicFormWidget;
Expand All @@ -10,14 +11,12 @@

Yii::$app->assetManager->forceCopy = true;

iCheckAsset::register($this);
NSyncPluginAsset::register($this);

$this->registerJs("$('#nss-form-pjax').NSync();");

?>

<?php Pjax::begin(['id' => 'nss-form-pjax', 'enableReplaceState' => false, 'scrollTo' => true]) ?>
<?php Pjax::begin(['id' => 'nss-form-pjax', 'enablePushState' => false, 'enableReplaceState' => false]) ?>
<?php $this->registerJs("$('#nss-form-pjax').NSync();"); ?>
<?php $form = ActiveForm::begin([
'id' => 'dynamic-form',
'action' => 'set-nss',
Expand All @@ -29,25 +28,20 @@
<?= Html::activeHiddenInput($model, "id") ?>
<?= Html::activeHiddenInput($model, "domain") ?>

<div class="row">
<div class="col-md-12 text-right ">
<?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-default']) ?>
</div>
</div>

<?php Box::begin(); ?>
<div class="row" style="margin-top: 15pt;">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel-body inline-form-selector">
<?= $form->field($model, 'nameservers') ?>
</div>
</div>
<div class="col-md-10 inline-form-selector">
<?= Html::activeTextInput($model, 'nameservers', ['class' => 'form-control']) ?>
</div>
<div class="col-md-2 text-right">
<?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-default']) ?>
</div>
</div>
<?php Box::end(); ?>

<div class="row">
<div class="col-md-12">
<div class="panel panel-info">
<div class="panel panel-default">
<div class="panel-body">
<?php DynamicFormWidget::begin([
'widgetContainer' => 'dynamicform_wrapper', // required: only alphanumeric characters plus "_" [A-Za-z0-9_]
Expand Down

0 comments on commit 91fd645

Please sign in to comment.