Commit 4147b7cd authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make enter key submit search form in userlist element (FF, bug #628437)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent a4eb7ea2
......@@ -728,3 +728,15 @@ function updateUnreadCount(n, decrement) {
}
}
// Work around hack for Mochikit Event key function
// (returns 0 for ff and onkeypress)
function keypressKeyCode(e) {
if (typeof(e._event.charCode) != 'undefined' && e._event.charCode !== 0 &&
!MochiKit.Signal._specialMacKeys[e._event.charCode]) {
return e._event.charCode;
}
if (e._event.keyCode && (typeof(e._event.charCode) == 'undefined' || e._event.charCode == 0)) {
return e._event.keyCode;
}
return 0;
}
......@@ -75,7 +75,7 @@
{{$name}}_searchfunc({});
connect('{{$name}}_search', 'onkeypress', function (k) {
if (k.key().code == 13) {
if (keypressKeyCode(k) == 13) {
{{$name}}_searchfunc({'query': $('{{$name}}_search').value});
k.stop();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment