From db055bfa677bf07a11c7b95cfcc7e170044c943a Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 3 Mar 2014 14:32:07 +0100 Subject: [PATCH] Update Proto.TimePicker.js fix getHeight add default value '00:00' when input is incorrect --- Proto.TimePicker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Proto.TimePicker.js b/Proto.TimePicker.js index 1bca2e7..1715e6a 100644 --- a/Proto.TimePicker.js +++ b/Proto.TimePicker.js @@ -136,6 +136,7 @@ // Hide timepicker on blur elm.on('blur', function() { if (!tpOver) { + elm.value = '00:00'; $tpDiv.hide(); } }); @@ -167,7 +168,7 @@ // Loop to next item. $selected.removeClassName(selectedClass); prev = $tpList.down("li:last").addClassName(selectedClass)[0]; - $tpDiv.scrollTop = prev.positionedOffset().top - prev.getHeight; + $tpDiv.scrollTop = prev.positionedOffset().top - prev.getHeight(); } e.stop(); return false; @@ -180,7 +181,7 @@ if (next) { next.addClassName(selectedClass); $selected.removeClassName(selectedClass); - if (next.positionedOffset().top + next.getHeight() > top + $tpDiv.getHeight) { + if (next.positionedOffset().top + next.getHeight() > top + $tpDiv.getHeight()) { $tpDiv.scrollTop = top + next.getHeight(); } }