MDL-36934 Only set the autosubmit class on selects when required

The url_select class can optionally show a button (much like the non-JS
fallback). In this case, the autosubmit nature of the form shouldn't be
enforced and it should only submit on the button.
This commit is contained in:
Andrew Robert Nicols
2012-12-19 12:27:17 +00:00
committed by sam marshall
parent 5eadb30e07
commit 1365b07390
+8 -2
View File
@@ -1425,9 +1425,15 @@ class core_renderer extends renderer_base {
$output .= html_writer::label($select->label, $select->attributes['id'], false, $select->labelattributes);
}
$select->attributes['class'] = 'autosubmit';
$classes = array();
if (!$select->showbutton) {
$classes[] = 'autosubmit';
}
if ($select->class) {
$select->attributes['class'] .= ' ' . $select->class;
$classes[] = $select->class;
}
if (count($classes)) {
$select->attributes['class'] = implode(' ', $classes);
}
if ($select->helpicon instanceof help_icon) {