[FIX] search view field visible through dropdown menu
authorXavier Morel <xmo@openerp.com>
Wed, 6 Mar 2013 11:00:51 +0000 (12:00 +0100)
committerXavier Morel <xmo@openerp.com>
Wed, 6 Mar 2013 11:00:51 +0000 (12:00 +0100)
xmo@openerp.com-20130305093619-s1e5fbl80r7qnk5l added zIndex on wrong
element of search view (view itself instead of just the autocompletion
drop-down) leading to the search view text field being visible over
the "more" section of the menu.

Move zIndex setting to the right place (on the missing
`autocomplete('widget')` indirection, and on open as jquery ui
autocomplete apparently decides to reset the dropdown's z-index each
time it is open)

bzr revid: xmo@openerp.com-20130306110051-1wfhxaylsn71skjp

addons/web/static/src/js/search.js

index 1c83460..5712254 100644 (file)
@@ -324,7 +324,10 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
                 e.preventDefault();
                 break;
             }
-        }
+        },
+        'autocompleteopen': function () {
+            this.$el.autocomplete('widget').css('z-index', 3);
+        },
     },
     /**
      * @constructs instance.web.SearchView
@@ -457,7 +460,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
             autoFocus: true,
             minLength: 1,
             delay: 0
-        }).css('z-index', 3).data('autocomplete');
+        }).data('autocomplete');
 
         // MonkeyPatch autocomplete instance
         _.extend(autocomplete, {