[FIX] filter preceded by an invisible filter in the same group
authorXavier Morel <xmo@openerp.com>
Thu, 21 Mar 2013 15:51:23 +0000 (16:51 +0100)
committerXavier Morel <xmo@openerp.com>
Thu, 21 Mar 2013 15:51:23 +0000 (16:51 +0100)
commit3c5d38918b3ddca8361f96e452402e1154fa8876
tree6e935c98e477ea3d5198ce05933f0741b081833b
parent3b2e26af1810b38f4d86fe1743ed222ef232509f
[FIX] filter preceded by an invisible filter in the same group

On click on a filter in the drawer, FilterGroup would just match the
offset of the filter in the group's DOM with an index in the internal
#filters array.

This worked until invisible fields, and then again only for filters
*preceded* by an invisible sibling in the same group: invisible
filters are not rendered in the DOM, so the indexes would get out of
sync.

Fix by using explicit indexes stored in a filter's @data-index and
using that to get the filter object/node.

An alternative fix (but hackier I think): instead of not rendering
invisible filters, render them with display: none. Remains an option
in the future if needed...

lp bug: https://launchpad.net/bugs/1157125 fixed

bzr revid: xmo@openerp.com-20130321155123-211iht7c6zme712e
addons/web/static/src/js/search.js
addons/web/static/src/xml/base.xml
addons/web/static/test/search.js