in input, trigger change on clear if changeonkeypress is true
This commit is contained in:
parent
6da40d325c
commit
3a87e8eb5f
1 changed files with 10 additions and 5 deletions
|
@ -592,14 +592,19 @@ Ox.Input = function(options, self) {
|
|||
function clear() {
|
||||
// fixme: set to min, not zero
|
||||
// fixme: make this work for password
|
||||
var value = '';
|
||||
self.options.value = '';
|
||||
if (self.options.type == 'float') {
|
||||
value = '0.0';
|
||||
self.options.value = '0.0';
|
||||
} else if (self.options.type == 'int') {
|
||||
value = '0'
|
||||
self.options.value = '0'
|
||||
}
|
||||
self.$input.val(value);
|
||||
cursor(0, value.length);
|
||||
self.$input.val(self.options.value);
|
||||
cursor(0, self.options.value.length);
|
||||
self.options.changeOnKeypress && that.triggerEvent({
|
||||
change: {
|
||||
value: self.options.value
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function clickArrow(i) {
|
||||
|
|
Loading…
Reference in a new issue