forked from 0x2620/oxjs
exec regex
This commit is contained in:
parent
8906cecd3e
commit
23adaa05df
3 changed files with 12 additions and 13 deletions
|
|
@ -473,17 +473,17 @@ Ox.Input = function(options, self) {
|
|||
} else if (value == '.') {
|
||||
value = '0.' + self.decimals;
|
||||
cursor = [2, value.length];
|
||||
} else if (!/\./(value)) {
|
||||
value += '.' + self.decimals
|
||||
} else if (!/\./.test(value)) {
|
||||
value += '.' + self.decimals;
|
||||
cursor = [value.indexOf('.'), value.length];
|
||||
} else if (/^\./(value)) {
|
||||
} else if (/^\./.test(value)) {
|
||||
value = '0' + value;
|
||||
cursor = [2, value.length];
|
||||
} else if (/\.$/(value)) {
|
||||
} else if (/\.$/.test(value)) {
|
||||
//Ox.print('$$$$$$$$$$$')
|
||||
value += self.decimals;
|
||||
cursor = [value.indexOf('.') + 1, value.length];
|
||||
} else if (/\./(value) && self.options.decimals) {
|
||||
} else if (/\./.test(value) && self.options.decimals) {
|
||||
length = value.split('.')[1].length;
|
||||
if (length > self.options.decimals) {
|
||||
value = value.substr(0, value.indexOf('.') + 1 + self.options.decimals);
|
||||
|
|
@ -499,7 +499,7 @@ Ox.Input = function(options, self) {
|
|||
cursor = [0, 1];
|
||||
}
|
||||
}
|
||||
while (/^0\d/(value)) {
|
||||
while (/^0\d/.test(value)) {
|
||||
value = value.substr(1, value.length);
|
||||
}
|
||||
if (!regexp.test(value) || value < self.options.min || value > self.options.max) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue