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() {
|
function clear() {
|
||||||
// fixme: set to min, not zero
|
// fixme: set to min, not zero
|
||||||
// fixme: make this work for password
|
// fixme: make this work for password
|
||||||
var value = '';
|
self.options.value = '';
|
||||||
if (self.options.type == 'float') {
|
if (self.options.type == 'float') {
|
||||||
value = '0.0';
|
self.options.value = '0.0';
|
||||||
} else if (self.options.type == 'int') {
|
} else if (self.options.type == 'int') {
|
||||||
value = '0'
|
self.options.value = '0'
|
||||||
}
|
}
|
||||||
self.$input.val(value);
|
self.$input.val(self.options.value);
|
||||||
cursor(0, value.length);
|
cursor(0, self.options.value.length);
|
||||||
|
self.options.changeOnKeypress && that.triggerEvent({
|
||||||
|
change: {
|
||||||
|
value: self.options.value
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickArrow(i) {
|
function clickArrow(i) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue