Skip to content

Commit b34a32a

Browse files
committed
1.0.2
Fixed the reset of button when enabled ActiveForm enabledAjaxValidation Close #4
1 parent 9a4a99f commit b34a32a

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
vendor
2+
.idea

LockBsFormAsset.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* Use this bundle when you have install yii2-bootstrap
2020
*
21-
* @version 1.0.0
21+
* @version 1.0.2
2222
*
2323
* @author lichunqiang <[email protected]>
2424
* @license MIT

LockFormAsset.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* Asset bundle for the widget.
1818
*
19-
* @version 1.0.0
19+
* @version 1.0.2
2020
*
2121
* @author lichunqiang <[email protected]>
2222
* @license MIT

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Make form submit button disabled when the form submit.
99
## Install
1010

1111
```
12-
$ composer require light\yii2-lock-form=*
12+
$ composer require light\yii2-lock-form=~1.0.2
1313
```
1414

1515
## Usage

assets/lock.bootstrap.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212
function resetLoading() {
1313
var $self = $(this),
14-
$submit = $self.data('yiiActiveForm').submitObject;
14+
_data = $self.data('yiiActiveForm'),
15+
$submit = _data.submitObject;
16+
17+
if (!_data.submitting) {
18+
return null;
19+
}
1520
if (!$submit) {
1621
$submit = $self.find('[type=submit]');
1722
}

assets/lock.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,17 @@
9292
$submit.button('loading');
9393
}
9494
function resetLoading() {
95-
var $self = $(this),
96-
$submit = $self.data('yiiActiveForm').submitObject;
97-
if (!$submit) {
98-
$submit = $self.find('[type=submit]');
99-
}
100-
$submit.button('reset');
95+
var $self = $(this),
96+
_data = $self.data('yiiActiveForm'),
97+
$submit = _data.submitObject;
98+
99+
if (!_data.submitting) {
100+
return null;
101+
}
102+
if (!$submit) {
103+
$submit = $self.find('[type=submit]');
104+
}
105+
$submit.button('reset');
101106
}
102107

103108
yii.lock = {

0 commit comments

Comments
 (0)