Menu

#386 (ok 2.11.3) A little JavaScript error in Query Window

closed-accepted
Interface (183)
1
2007-12-08
2007-11-24
No

In Query Window on pages Inport Files and SQL history there is a JavaScript error that points on this string:
document.getElementById('sqlquery').focus();

The point is that we have input field for SQL query to focus on only on pages sql and full, but not on pages history and files.

The problem string is generating in querywindow.php line 225.

Solution may be like this.

var sQuerydisplay_tab = document.getElementById('querydisplay_tab').value;
if (sQuerydisplay_tab == 'sql' || sQuerydisplay_tab == 'full') {
document.getElementById('sqlquery').focus();
}

Discussion

  • Marc Delisle

    Marc Delisle - 2007-11-26
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2007-11-26

    Logged In: YES
    user_id=210714
    Originator: NO

    A variant of your patch based on PHP works:
    Index: querywindow.php
    ===================================================================
    --- querywindow.php (revision 10945)
    +++ querywindow.php (copie de travail)
    @@ -221,8 +221,10 @@
    if (PMA_isValid($_REQUEST['init'])) {
    echo 'PMA_querywindowResize();' . "\n";
    }
    +if ($querydisplay_tab == 'sql' || $querydisplay_tab == 'full') {
    + echo "document.getElementById('sqlquery').focus();" . "\n";
    +}
    ?>
    -document.getElementById('sqlquery').focus();

     
  • Marc Delisle

    Marc Delisle - 2007-11-26
    • priority: 5 --> 1
    • summary: A little JavaScript error in Query Window --> (ok 2.11.3) A little JavaScript error in Query Window
    • status: open --> open-accepted
     
  • Marc Delisle

    Marc Delisle - 2007-12-08
    • status: open-accepted --> closed-accepted