From 9d2a3a819a588f0fad2aaac0b330bafe594954ec Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 29 Sep 2010 08:11:51 +0000 Subject: Focus search box or first edit field on page load --- program/js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index c42b62c9c..64cc7c631 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -301,10 +301,14 @@ function rcube_webmail() if (this.env.cid) this.enable_command('show', 'edit', true); - if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform) + if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform) { this.enable_command('save', true); - else + $("input[type='text']").first().select(); + } + else if (this.gui_objects.qsearchbox) { this.enable_command('search', 'reset-search', 'moveto', true); + $(this.gui_objects.qsearchbox).select(); + } if (this.contact_list && this.contact_list.rowcount > 0) this.enable_command('export', true); -- cgit v1.2.3