poll: press enter to validate input

pull/1/head
Pierre Bondoerffer 8 years ago
parent d483e10e77
commit 6b57bb2bbb
No known key found for this signature in database
GPG Key ID: C0C7C0C5063F2236

@ -285,7 +285,7 @@ define([
}; };
/* Called whenever an event is fired on an input element */ /* Called whenever an event is fired on an input element */
var handleInput = function (input) { var handleInput = function (input, isKeyup) {
var type = input.type.toLowerCase(); var type = input.type.toLowerCase();
var id = getRealtimeId(input); var id = getRealtimeId(input);
@ -363,8 +363,8 @@ define([
} }
}; };
var hideInputs = function (e) { var hideInputs = function (e, isKeyup) {
if ($(e.target).is('[type="text"]')) { if (!isKeyup && $(e.target).is('[type="text"]')) {
return; return;
} }
$('.lock[data-rt-id!="' + APP.userid + '"]').html(lockHTML); $('.lock[data-rt-id!="' + APP.userid + '"]').html(lockHTML);
@ -397,10 +397,11 @@ define([
switch (nodeName) { switch (nodeName) {
case 'INPUT': case 'INPUT':
if (isKeyup && (e.keyCode === 13 || e.keyCode === 27)) {
hideInputs(e, isKeyup);
return;
}
handleInput(target); handleInput(target);
//if (isKeyup && (e.keyCode === 13 || e.keyCode === 27)) {
//hideInputs(e, isKeyup);
//}
break; break;
case 'SPAN': case 'SPAN':
//case 'LABEL': //case 'LABEL':

Loading…
Cancel
Save