NaN safety
This commit is contained in:
parent
0118fdbd00
commit
cd1c957929
@ -278,7 +278,14 @@ define([
|
|||||||
case 'number':
|
case 'number':
|
||||||
debug("checkbox[tr-id='%s'] %s", id, input.value);
|
debug("checkbox[tr-id='%s'] %s", id, input.value);
|
||||||
if (APP.editable.col.indexOf(x) >= 0 || x === APP.userid) {
|
if (APP.editable.col.indexOf(x) >= 0 || x === APP.userid) {
|
||||||
Render.setValue(object, id, parseInt(input.value));
|
var value = parseInt(input.value);
|
||||||
|
|
||||||
|
if (isNaN(value)) {
|
||||||
|
console.error("Got NaN?!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Render.setValue(object, id, value);
|
||||||
change();
|
change();
|
||||||
} else {
|
} else {
|
||||||
debug('checkbox locked');
|
debug('checkbox locked');
|
||||||
@ -359,7 +366,6 @@ define([
|
|||||||
if (!APP.ready) { return; }
|
if (!APP.ready) { return; }
|
||||||
if (!isKeyup && e.which !== 1) { return; }
|
if (!isKeyup && e.which !== 1) { return; }
|
||||||
|
|
||||||
|
|
||||||
var target = e && e.target;
|
var target = e && e.target;
|
||||||
|
|
||||||
if (!target) { return void debug("NO TARGET"); }
|
if (!target) { return void debug("NO TARGET"); }
|
||||||
@ -384,6 +390,7 @@ define([
|
|||||||
case 'LABEL':
|
case 'LABEL':
|
||||||
var input = $('input[type="number"][id=' + $(target).attr('for') + ']');
|
var input = $('input[type="number"][id=' + $(target).attr('for') + ']');
|
||||||
var value = parseInt(input.val());
|
var value = parseInt(input.val());
|
||||||
|
|
||||||
input.val((value + 1) % 4);
|
input.val((value + 1) % 4);
|
||||||
|
|
||||||
handleInput(input[0]);
|
handleInput(input[0]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user