Skip to content

Commit 4738250

Browse files
committed
improved calculation of current index
1 parent b1d3c09 commit 4738250

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "2.9.0",
44
"description": "jQuery multipleInput",
55
"scripts": {
6-
"build": "npm install && (gulp || node node_modules/gulp/bin/gulp.js)"
6+
"build": "npm install && (gulp || node node_modules/gulp/bin/gulp.js)"
77
},
88
"repository": {
99
"type": "git",
@@ -14,7 +14,7 @@
1414
"email": "unclead.nsk@gmail.com"
1515
},
1616
"keywords": [
17-
"jquery"
17+
"jquery"
1818
],
1919
"license": "BSD-3-Clause",
2020
"bugs": {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@
424424

425425
var getCurrentIndex = function($wrapper) {
426426
return $wrapper
427-
.children('.multiple-input-list')
428-
.children('tbody')
429-
.children('.multiple-input-list__item')
430-
.length;
427+
.find('.multiple-input-list .multiple-input-list__item')
428+
.filter(function(){
429+
return $(this).parents('.multiple-input').first().attr('id') === $wrapper.attr('id');
430+
}).length;
431431
};
432432

433433
String.prototype.replaceAll = function (search, replace) {

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)