From 33862c31eb0931eced6e49b795b73069dc6a5725 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 29 Apr 2010 10:19:15 +0000 Subject: [PATCH] Updated focus method - Work iwth password dialogs again git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17929 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/include/gosa.js | 16 ++++++++++++++++ gosa-core/ihtml/themes/default/login.tpl | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gosa-core/html/include/gosa.js b/gosa-core/html/include/gosa.js index 83f956fc7..135105ecc 100644 --- a/gosa-core/html/include/gosa.js +++ b/gosa-core/html/include/gosa.js @@ -95,10 +95,26 @@ function acl_toggle_all(regex) /* Global key handler to estimate which element gets the next focus if enter is pressed */ function keyHandler(DnEvents) { + + var element = Event.element(DnEvents); + // determines whether Netscape or Internet Explorer k = (Prototype.Browser.Gecko) ? DnEvents.keyCode : window.event.keyCode; if (k == 13) { // enter key pressed + + + // Stop 'Enter' key-press from beeing handled internally + Event.stop(DnEvents); + if(typeof(nextfield)!='undefined') { + + var next_element = $(nextfield); + if(next_element.type == 'submit'){ + $('mainform').submit(); + return(false); + } + + if(nextfield == 'login') { return true; // submit, we finished all fields } else { // we are not done yet, send focus to next box diff --git a/gosa-core/ihtml/themes/default/login.tpl b/gosa-core/ihtml/themes/default/login.tpl index 049d83501..60e02adea 100644 --- a/gosa-core/ihtml/themes/default/login.tpl +++ b/gosa-core/ihtml/themes/default/login.tpl @@ -9,7 +9,7 @@ -
+ {image path="images/empty.png" align="top" action="focus"} {$msg_dialogs} @@ -63,7 +63,7 @@
- +
-- 2.30.2