From a2da1df78ed359de318ade08169db7d088ce722b Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 29 Sep 2017 12:52:36 +0200 Subject: [PATCH] [FIX] web, portal: checkbox rendering This reverts commit b94939377a7dee66f7860f4ef9e59be85cccf2ba. The commit was breaking most of the backend checkboxes trying to fix a frontend one. On top of the revert, this commit adds frontend-only style to fix the frontend checkboxes. --- addons/portal/static/src/less/website.ui.less | 9 +++++++++ addons/web/static/src/js/core/dom.js | 10 +++++----- addons/web/static/src/less/webclient_extra.less | 13 ++----------- addons/web/static/tests/views/form_tests.js | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/addons/portal/static/src/less/website.ui.less b/addons/portal/static/src/less/website.ui.less index c4b57e018bf..d5f508d18a5 100644 --- a/addons/portal/static/src/less/website.ui.less +++ b/addons/portal/static/src/less/website.ui.less @@ -64,3 +64,12 @@ body.o_connected_user { } } } + +// TODO should be a common backend/frontend style +div.o_checkbox { + display: inline-block; + vertical-align: sub; + > input + span { + display: none; + } +} diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index da125aa72af..6ca13f18e4e 100644 --- a/addons/web/static/src/js/core/dom.js +++ b/addons/web/static/src/js/core/dom.js @@ -265,19 +265,19 @@ return { * @returns {jQuery} */ renderCheckbox: function (options) { - var $container = $('
'); + var $container = $('
'); if (options && options.prop) { - $container.find('input').prop(options.prop); + $container.children('input').prop(options.prop); } if (options && options.text) { - $container.find('label').append( + $container = $('