Skip to content

Commit b0a8d2c

Browse files
committed
Merge pull request #4 from Nafania/feature_1
fix README.md and default properties
2 parents 526a6b8 + 32dec6e commit b0a8d2c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

AjaxSubmitButton.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ protected function registerAjaxScript()
9191
{
9292
$view = $this->getView();
9393

94+
if(!isset($this->ajaxOptions['type'])) {
95+
$this->ajaxOptions['type'] = new \yii\web\JsExpression('$(this).parents("form").attr("method")');
96+
}
97+
98+
if(!isset($this->ajaxOptions['url'])) {
99+
$this->ajaxOptions['url'] = new \yii\web\JsExpression('$(this).parents("form").attr("action")');
100+
}
101+
94102
if(!isset($this->ajaxOptions['data']) && isset($this->ajaxOptions['type']))
95103
$this->ajaxOptions['data'] = new \yii\web\JsExpression('$(this).parents("form").serialize()');
96104

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ php composer.phar require demogorgorn/yii2-ajax-submit-button "*"
7171
or add
7272

7373
```
74-
"demogorgorn/yii2-yii2-ajax-submit-button": "*"
74+
"demogorgorn/yii2-ajax-submit-button": "*"
7575
```
7676

7777
to the require section of your `composer.json` file and run `composer update`.

0 commit comments

Comments
 (0)