On insert page, open the auto-complete list when it gets the focus
authorioguix <ioguix@free.fr>
Mon, 26 Jul 2010 08:51:46 +0000 (10:51 +0200)
committerioguix <ioguix@free.fr>
Mon, 26 Jul 2010 08:51:46 +0000 (10:51 +0200)
js/ac_insert_row.js

index ae062a3d7f3ff24d0f8225681c00ed625e597cd9..3517becb9ba192aef48ae273ce1e694cb1b0c23d 100644 (file)
@@ -192,7 +192,7 @@ jQuery(document).ready(function () {
        /* register some global value in the ppa namespace */
        jQuery.ppa = {
                fklist: jQuery('#fklist'),
-               attrs: jQuery('input[id^=attr_]'),
+               attrs: jQuery('input[id^=attr_]'), // select fields with FK
                fkbg: jQuery('#fkbg'),
                i:0, // selected value indice
                o:0 // offset when navigating prev/next
@@ -209,6 +209,12 @@ jQuery(document).ready(function () {
                        if (e.keyCode == 13 && jQuery.ppa.fklist[0].style.display == 'block')
                                return false;
                });
+
+       /* open the list when the field get the focus */
+       jQuery.ppa.attrs
+               .focus(function (e) {
+                       openlist(this);
+               });
        
        /* enable/disable auto-complete according to the checkbox */
        triggerAc(