From 3a87e8eb5f79fc2a230f3083b3f284072a3e6fde Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 1 Sep 2011 07:43:03 +0000 Subject: [PATCH] in input, trigger change on clear if changeonkeypress is true --- source/Ox.UI/js/Form/Ox.Input.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index 918e5180..a439ea06 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -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) {