From b94939377a7dee66f7860f4ef9e59be85cccf2ba Mon Sep 17 00:00:00 2001 From: rde Date: Fri, 22 Sep 2017 14:16:58 +0200 Subject: [PATCH] [IMP] web: improve renderCheckbox to be re-usable in front end Before this commit, the label was into a display block that add a return line between the cehckbox and the label. It was not visible in backend, because label by defaut is displayed without renderCheckbox. (no options.text provided) Now renderCheckbox render correctly with the same code in frontend and backend --- 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 ++++---- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index 6ca13f18e4e..da125aa72af 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.children('input').prop(options.prop); + $container.find('input').prop(options.prop); } if (options && options.text) { - $container = $('