Skip to content

Commit 9d87986

Browse files
author
Eugene Tupikov
committed
Attach click events to the widget wrapper instead of $(document)
1 parent 01939af commit 9d87986

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Yii2 multiple input change log
44
1.2.7 in development
55
--------------------
66

7+
- Bug #55: Attach click events to the widget wrapper instead of `$(document)`
8+
79
1.2.6
810
-----
911

src/assets/src/js/jquery.multipleInput.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@
7979
attributeDefaults: {}
8080
});
8181

82-
$(document).on('click.multipleInput', '#' + settings.id + ' .js-input-remove', function (e) {
82+
83+
$wrapper.on('click.multipleInput', '.js-input-remove', function (e) {
8384
e.preventDefault();
8485
methods.removeInput.apply(this);
8586
});
8687

87-
$(document).on('click.multipleInput', '#' + settings.id + ' .js-input-plus', function (e) {
88+
$wrapper.on('click.multipleInput', '.js-input-plus', function (e) {
8889
e.preventDefault();
8990
methods.addInput.apply(this);
9091
});

src/assets/src/js/jquery.multipleInput.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)