Changeset 2241


Ignore:
Timestamp:
Dec 18, 2012, 12:46:39 PM (6 years ago)
Author:
matthijs
Message:

luci: Don't try to focus hidden text fields.

On page load, luci tries to focus the first non-disabled text field on
the page. However, it would try to do this, even if that text field was
hidden.

In IE8, this results in a javascript error, since the element cannot be
focused.

This would occur for example on the internet settings page in DHCP mode,
the first non-disabled text field is the text field for the custom DNS
server, which is hidden as long as the dropdown is set to "Automatic".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/luci/themes/fon/luasrc/view/themes/fon/tail.htm

    r1321 r2241  
    2626                                for (var i=0; i < document.forms[0].elements.length; i++) {     
    2727                                        var e = document.forms[0].elements[i];
    28                                         if ((e.type == "text" || e.type == "password") && !e.disabled) {
     28                                        if ((e.type == "text" || e.type == "password") && !e.disabled && e.style.display != "none") {
    2929                                                e.focus();
    3030                                                break;
Note: See TracChangeset for help on using the changeset viewer.