From 8155a49cf7065115c3d167aa71b9aa05c865bf89 Mon Sep 17 00:00:00 2001 From: s72785 Date: Fri, 29 May 2015 00:06:19 +0200 Subject: [PATCH] prevent NaN fixes usability glitch deleting content of input field results in not useable UI --- static/js/crementing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/crementing.js b/static/js/crementing.js index 3b463e5..c4a1cc4 100644 --- a/static/js/crementing.js +++ b/static/js/crementing.js @@ -8,5 +8,5 @@ calling like */ function crmnt( e, i ) { /* read: in-/decrement ( dom-element, signed-integer ) */ var d = parseInt( e.value ) + i; - e.value = ( d <= 0 )? 0 : d; + e.value = ( d <= 0 || isNaN(d) )? 0 : d; }