From 8c1e052007456ae34d2b0e7fbe0887ada7100fef Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 4 Oct 2011 09:24:24 +0200 Subject: [PATCH 1/2] [fix] use a more solid selector to get $element bzr revid: valentin.lab@kalysto.org-20111004072424-uwx50578hhafe2xm --- addons/web/static/src/js/view_form.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 11ebad8d093..773cd882405 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -688,7 +688,10 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form. this.width = this.node.attrs.width; }, start: function() { - this.$element = this.view.$element.find('.' + this.element_class); + // avoiding find('.' + this.element_class) form because it doesn't work + // if class contains some dots. + this.$element = this.view.$element + .find('[class~="' + this.element_class + '"]'); }, process_modifiers: function() { var compute_domain = openerp.web.form.compute_domain; From 63cf2019e5b0b74920c92765436e22c36fb8239c Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 4 Oct 2011 12:20:50 +0200 Subject: [PATCH 2/2] [imp] more efficient selector. bzr revid: valentin.lab@kalysto.org-20111004102050-http3jvu0sf78fmx --- addons/web/static/src/js/view_form.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 773cd882405..b5b54722d68 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -688,10 +688,8 @@ openerp.web.form.Widget = openerp.web.Widget.extend(/** @lends openerp.web.form. this.width = this.node.attrs.width; }, start: function() { - // avoiding find('.' + this.element_class) form because it doesn't work - // if class contains some dots. - this.$element = this.view.$element - .find('[class~="' + this.element_class + '"]'); + this.$element = this.view.$element.find( + '.' + this.element_class.replace(/([#;&,.+*~\:!^$\[\]=>|\/])/g,'\\$1')); }, process_modifiers: function() { var compute_domain = openerp.web.form.compute_domain;