Bugzilla – Attachment 57881 Details for
Bug 17566
Change initial focus in item editor depending on last action
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17566: [Follow-up] Initial focus on first select or input
Bug-17566-Follow-up-Initial-focus-on-first-select-.patch (text/plain), 2.01 KB, created by
Marcel de Rooy
on 2016-12-02 07:22:15 UTC
(
hide
)
Description:
Bug 17566: [Follow-up] Initial focus on first select or input
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-12-02 07:22:15 UTC
Size:
2.01 KB
patch
obsolete
>From 7544afa9b274f68742bf3a514a60c71e58f80969 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 1 Dec 2016 14:56:39 +0100 >Subject: [PATCH] Bug 17566: [Follow-up] Initial focus on first select or input >Content-Type: text/plain; charset=utf-8 > >Previous patch just set the focus to the first input, because the focus >on the first select does not show up in some browsers (incl FF). Joubu >complained about that, which is not unreasonable :) > >This patch puts the focus on the first subfield (under conditions described >earlier). We do not solve all browser problems here, but it still is an >improvement compared to the original focus. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 1b90ee9..0df5302 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -83,11 +83,17 @@ $(document).ready(function(){ > multiCopyControl.toggle(); > }); > [% IF last_action == "additem" || last_action == "saveitem" || last_action == "delitem" %] >+ // Focus on the top search box > $("input:text:visible:first").focus(); > [% ELSE %] >- $("fieldset.rows input:visible:first").focus(); >- // FIXME: The first input gets focus. Note that focus on the first >- // select does not show properly. >+ // Focus on first select or input >+ var firstsubfield = $("fieldset.rows div.subfield_line")[0]; >+ if( $(firstsubfield).find("select").length > 0 ) { >+ $("fieldset.rows select:first").focus(); >+ // TODO: This focus does not show up in all browsers (incl FF). >+ } else { >+ $("fieldset.rows input:visible:first").focus(); >+ } > [% END %] > }); > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17566
:
57257
|
57259
|
57281
| 57881