Skip to content

Commit 0bd2017

Browse files
author
Nguyen Khac Chinh
committed
fix bug: error get value in InputCheckbox
1 parent 530a1ae commit 0bd2017

File tree

4 files changed

+9
-1231
lines changed

4 files changed

+9
-1231
lines changed

dist/jquery.input.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function (global, factory) {
22
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :
33
typeof define === 'function' && define.amd ? define(['jquery'], factory) :
4-
(factory(global.jQuery));
5-
}(this, (function ($) { 'use strict';
4+
(global = global || self, factory(global.jQuery));
5+
}(this, function ($) { 'use strict';
66

77
$ = $ && $.hasOwnProperty('default') ? $['default'] : $;
88

@@ -754,26 +754,24 @@
754754
}, {
755755
key: "get",
756756
value: function get() {
757-
var _this2 = this;
758-
759757
var values = [];
760758
this.$().filter(':checked').each(function (_, ele) {
761-
values.push($(_this2).val(ele));
759+
values.push($(ele).val());
762760
});
763761
return values;
764762
}
765763
}, {
766764
key: "set",
767765
value: function set(newValues) {
768-
var _this3 = this;
766+
var _this2 = this;
769767

770768
// eslint-disable-next-line no-param-reassign
771769
newValues = isArray(newValues) ? newValues : [newValues];
772770
this.$().each(function () {
773771
$(this).prop('checked', false);
774772
});
775773
foreach(newValues, function (value) {
776-
_this3.$().filter("[value=\"".concat(value, "\"]")).prop('checked', true);
774+
_this2.$().filter("[value=\"".concat(value, "\"]")).prop('checked', true);
777775
});
778776
}
779777
}, {
@@ -1218,4 +1216,4 @@
12181216
return $self;
12191217
};
12201218

1221-
})));
1219+
}));

0 commit comments

Comments
 (0)