Skip to content

Commit

Permalink
Fix #4: Correct source plugin incorrect unmasking for non standard `r…
Browse files Browse the repository at this point in the history
…adixPoint`
  • Loading branch information
kartik-v committed Jun 7, 2018
1 parent 9e9fea8 commit fb3c7a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Change Log: `yii2-number`

## Version 1.0.1

**Date:** 01-May-2018
**Date:** 07-Jun-2018

- (bug #4): Correct source plugin incorrect unmasking for non standard `radixPoint`.
- (bug #3): Fix `val.replace` error due to inputmask auto unmask.

## Version 1.0.0
Expand Down
5 changes: 4 additions & 1 deletion assets/js/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
init: function () {
var self = this, $elDisp = self.$elDisp, $elSave = self.$elSave, opts = self.options.maskedInputOptions;
$elDisp.off('.numberControl').on('change.numberControl blur.numberControl', function () {
var num = $elDisp.inputmask('unmaskedvalue');
var num = $elDisp.inputmask('unmaskedvalue'), radix = opts.radixPoint || '.';
if (radix !== '.') {
num = (num + '').replace(radix, '.');
}
$elSave.val(num).trigger('change');
}).inputmask(opts);
},
Expand Down
3 changes: 1 addition & 2 deletions assets/js/number.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb3c7a3

Please sign in to comment.