Ox.Input: trigger change event when clicking arrows
This commit is contained in:
parent
72ed28494d
commit
3fbefa2278
1 changed files with 6 additions and 2 deletions
|
@ -694,12 +694,16 @@ Ox.Input = function(options, self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickArrow(i) {
|
function clickArrow(i) {
|
||||||
|
var originalValue = self.options.value;
|
||||||
self.options.value = Ox.limit(
|
self.options.value = Ox.limit(
|
||||||
parseFloat(self.options.value) + (i == 0 ? -1 : 1) * self.options.arrowStep,
|
parseFloat(self.options.value) + (i == 0 ? -1 : 1) * self.options.arrowStep,
|
||||||
self.options.min,
|
self.options.min,
|
||||||
self.options.max
|
self.options.max
|
||||||
).toString();
|
).toString();
|
||||||
|
if (self.options.value != originalValue) {
|
||||||
self.$input.val(self.options.value);//.focus();
|
self.$input.val(self.options.value);//.focus();
|
||||||
|
that.triggerEvent('change', {value: self.options.value});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickMenu(data) {
|
function clickMenu(data) {
|
||||||
|
@ -780,7 +784,7 @@ Ox.Input = function(options, self) {
|
||||||
function keydown(event) {
|
function keydown(event) {
|
||||||
var oldCursor = cursor(),
|
var oldCursor = cursor(),
|
||||||
oldValue = self.options.value,
|
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) &&
|
hasDeletedSelectedEnd = (event.keyCode == 8 || event.keyCode == 46) &&
|
||||||
oldCursor[0] < oldCursor[1] && oldCursor[1] == oldValue.length;
|
oldCursor[0] < oldCursor[1] && oldCursor[1] == oldValue.length;
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in a new issue