From 5d2f105e504a0e77b412c20eaa9142b517a80356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Massart?= Date: Tue, 4 Oct 2016 14:55:33 +0200 Subject: [PATCH] MDL-56178 theme_boost: Display drop zones labels The markup has changed so we now need to target .sr-only rather than just .accesshide. I did keep the latter in case it's still used somewhere, in a custom form field for instance. The ideal solution was to tell QuickForm to display the labels of those elements in the group. That works for Boost, but that did not work for Clean. The rendering mechanics of QuickForm decides to not print the label, unless it's set as hidden... the CSS hack remains. --- theme/boost/scss/moodle/question.scss | 21 +++++++++++++++---- theme/bootstrapbase/less/moodle/forms.less | 8 ------- theme/bootstrapbase/less/moodle/question.less | 1 + theme/bootstrapbase/style/moodle.css | 9 +------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/theme/boost/scss/moodle/question.scss b/theme/boost/scss/moodle/question.scss index 5945cd631ff..6dd726aeb2f 100644 --- a/theme/boost/scss/moodle/question.scss +++ b/theme/boost/scss/moodle/question.scss @@ -207,10 +207,23 @@ margin-right: 0.3em; } -body.path-question-type .fitem_fgroup .accesshide { - font: inherit; - position: static; - padding-right: .3em; +body.path-question-type { + /* Hacks to display the labels within a form group. */ + .fitem_fgroup .accesshide { + font: inherit; + position: static; + padding-right: .3em; + } + .form-group .sr-only { + position: static; + width: auto; + height: auto; + padding: 0; + margin: 0; + overflow: visible; + clip: auto; + border: 0; + } } .que { diff --git a/theme/bootstrapbase/less/moodle/forms.less b/theme/bootstrapbase/less/moodle/forms.less index 3087c476dd9..dd3099eb9b8 100644 --- a/theme/bootstrapbase/less/moodle/forms.less +++ b/theme/bootstrapbase/less/moodle/forms.less @@ -102,14 +102,6 @@ form { display: inline; float: none; } -.mform .ftags label.accesshide { - display: block; - position: static; -} -.mform .ftags select { - margin-bottom: 0.7em; - min-width: 22em; -} .mform .helplink img { margin: 0 .45em; padding: 0; diff --git a/theme/bootstrapbase/less/moodle/question.less b/theme/bootstrapbase/less/moodle/question.less index 9a1f072f8c7..b245ab77fe9 100644 --- a/theme/bootstrapbase/less/moodle/question.less +++ b/theme/bootstrapbase/less/moodle/question.less @@ -177,6 +177,7 @@ margin-right: 0.3em; } body.path-question-type .fitem_fgroup .accesshide { + /* Hack to display the labels within a form group. */ font: inherit; position: static; padding-right: .3em; diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index 0869e115743..0fb0b40617d 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -6340,6 +6340,7 @@ table.message .searchresults td { margin-right: 0.3em; } body.path-question-type .fitem_fgroup .accesshide { + /* Hack to display the labels within a form group. */ font: inherit; position: static; padding-right: .3em; @@ -12862,14 +12863,6 @@ form { display: inline; float: none; } -.mform .ftags label.accesshide { - display: block; - position: static; -} -.mform .ftags select { - margin-bottom: 0.7em; - min-width: 22em; -} .mform .helplink img { margin: 0 .45em; padding: 0;