Ox.Input: trigger change event when clicking arrows

This commit is contained in:
rolux 2012-06-14 14:31:44 +02:00
parent 72ed28494d
commit 3fbefa2278

View file

@ -694,12 +694,16 @@ Ox.Input = function(options, self) {
}
function clickArrow(i) {
var originalValue = self.options.value;
self.options.value = Ox.limit(
parseFloat(self.options.value) + (i == 0 ? -1 : 1) * self.options.arrowStep,
self.options.min,
self.options.max
).toString();
self.$input.val(self.options.value);//.focus();
if (self.options.value != originalValue) {
self.$input.val(self.options.value);//.focus();
that.triggerEvent('change', {value: self.options.value});
}
}
function clickMenu(data) {
@ -780,7 +784,7 @@ Ox.Input = function(options, self) {
function keydown(event) {
var oldCursor = cursor(),
oldValue = self.options.value,
newValue = oldValue.slice(0, oldCursor[0] - 1),
newValue = oldValue.toString().slice(0, oldCursor[0] - 1),
hasDeletedSelectedEnd = (event.keyCode == 8 || event.keyCode == 46) &&
oldCursor[0] < oldCursor[1] && oldCursor[1] == oldValue.length;
if (